結果

問題 No.143 豆
ユーザー kuramubonnkuramubonn
提出日時 2023-02-01 21:06:13
言語 Java21
(openjdk 21)
結果
AC  
実行時間 138 ms / 1,000 ms
コード長 331 bytes
コンパイル時間 3,924 ms
コンパイル使用メモリ 71,804 KB
実行使用メモリ 56,168 KB
最終ジャッジ日時 2023-09-14 06:57:39
合計ジャッジ時間 7,116 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,992 KB
testcase_01 AC 133 ms
56,104 KB
testcase_02 AC 129 ms
55,676 KB
testcase_03 AC 131 ms
55,756 KB
testcase_04 AC 132 ms
56,144 KB
testcase_05 AC 134 ms
55,824 KB
testcase_06 AC 134 ms
55,776 KB
testcase_07 AC 132 ms
55,776 KB
testcase_08 AC 133 ms
55,620 KB
testcase_09 AC 133 ms
55,608 KB
testcase_10 AC 132 ms
55,908 KB
testcase_11 AC 129 ms
55,752 KB
testcase_12 AC 132 ms
55,816 KB
testcase_13 AC 134 ms
56,000 KB
testcase_14 AC 138 ms
55,892 KB
testcase_15 AC 136 ms
55,832 KB
testcase_16 AC 123 ms
56,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int mame = sc.nextInt() * sc.nextInt();
		int num = sc.nextInt();
		for(int i = 0 ; i < num ; i++) mame -= sc.nextInt();
		if(mame < 0) {
			System.out.println(-1);
		}else {
			System.out.print(mame);
		}
	}
}
0