結果

問題 No.143 豆
ユーザー YukimotoPGYukimotoPG
提出日時 2019-02-14 21:56:50
言語 Java19
(openjdk 21)
結果
AC  
実行時間 136 ms / 1,000 ms
コード長 283 bytes
コンパイル時間 3,107 ms
コンパイル使用メモリ 71,536 KB
実行使用メモリ 56,056 KB
最終ジャッジ日時 2023-09-30 17:26:02
合計ジャッジ時間 5,717 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,984 KB
testcase_01 AC 135 ms
55,772 KB
testcase_02 AC 132 ms
55,800 KB
testcase_03 AC 133 ms
55,712 KB
testcase_04 AC 134 ms
55,820 KB
testcase_05 AC 134 ms
55,792 KB
testcase_06 AC 135 ms
56,056 KB
testcase_07 AC 135 ms
55,988 KB
testcase_08 AC 135 ms
55,860 KB
testcase_09 AC 136 ms
55,888 KB
testcase_10 AC 135 ms
55,848 KB
testcase_11 AC 130 ms
55,664 KB
testcase_12 AC 132 ms
55,992 KB
testcase_13 AC 135 ms
55,748 KB
testcase_14 AC 136 ms
55,956 KB
testcase_15 AC 135 ms
55,760 KB
testcase_16 AC 126 ms
55,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		
		int mame = sc.nextInt() * sc.nextInt();
		int n = sc.nextInt();
		for (int i=0; i<n; i++) mame -= sc.nextInt();
		System.out.println(mame<0?-1:mame);
		
	}
}
0