結果
| 問題 | No.143 豆 |
| コンテスト | |
| ユーザー |
atkrym
|
| 提出日時 | 2016-10-24 01:20:34 |
| 言語 | Java (openjdk 26.0.2.1) |
| 結果 |
AC
|
| 実行時間 | 61 ms / 1,000 ms |
| + 547µs | |
| コード長 | 445 bytes |
| 記録 | |
| コンパイル時間 | 1,605 ms |
| コンパイル使用メモリ | 83,916 KB |
| 実行使用メモリ | 43,448 KB |
| 最終ジャッジ日時 | 2026-08-23 23:41:45 |
| 合計ジャッジ時間 | 3,908 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 |
ソースコード
import java.util.*;
public class Main {
private static Scanner sc = new Scanner(System.in);
public static void main(String[] args) throws Exception {
int sum = sc.nextInt()*sc.nextInt();
int f = sc.nextInt();
for (int i = 0;i < f;i++) {
sum -= sc.nextInt();
}
if (sum >= 0) {
System.out.println(sum);
} else {
System.out.println(-1);
}
}
}
atkrym