結果

問題 No.143 豆
ユーザー TatsuDXTatsuDX
提出日時 2016-09-08 23:55:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 133 ms / 1,000 ms
コード長 331 bytes
コンパイル時間 3,116 ms
コンパイル使用メモリ 72,792 KB
実行使用メモリ 56,452 KB
最終ジャッジ日時 2023-09-30 16:51:17
合計ジャッジ時間 6,178 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
56,096 KB
testcase_01 AC 129 ms
56,064 KB
testcase_02 AC 125 ms
55,608 KB
testcase_03 AC 127 ms
55,728 KB
testcase_04 AC 128 ms
55,908 KB
testcase_05 AC 128 ms
55,604 KB
testcase_06 AC 130 ms
56,032 KB
testcase_07 AC 133 ms
56,452 KB
testcase_08 AC 129 ms
55,652 KB
testcase_09 AC 131 ms
55,732 KB
testcase_10 AC 129 ms
55,636 KB
testcase_11 AC 127 ms
55,920 KB
testcase_12 AC 128 ms
55,936 KB
testcase_13 AC 129 ms
55,520 KB
testcase_14 AC 131 ms
55,972 KB
testcase_15 AC 131 ms
56,152 KB
testcase_16 AC 123 ms
55,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Test {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int s = sc.nextInt() * sc.nextInt(), n = sc.nextInt();
		for (int i = 0; i < n; i++) {
			s -= sc.nextInt();
		}
		if (s < 0) {
			System.out.println(-1);
		} else {
			System.out.println(s);
		}
	}
}
0