結果

問題 No.143 豆
ユーザー fal_rndfal_rnd
提出日時 2016-11-07 18:22:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 135 ms / 1,000 ms
コード長 284 bytes
コンパイル時間 2,013 ms
コンパイル使用メモリ 71,708 KB
実行使用メモリ 56,128 KB
最終ジャッジ日時 2023-09-30 16:53:52
合計ジャッジ時間 5,078 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,784 KB
testcase_01 AC 129 ms
55,788 KB
testcase_02 AC 126 ms
55,788 KB
testcase_03 AC 127 ms
56,128 KB
testcase_04 AC 129 ms
55,756 KB
testcase_05 AC 130 ms
55,724 KB
testcase_06 AC 129 ms
55,788 KB
testcase_07 AC 130 ms
55,776 KB
testcase_08 AC 128 ms
55,584 KB
testcase_09 AC 128 ms
55,876 KB
testcase_10 AC 128 ms
55,680 KB
testcase_11 AC 127 ms
55,776 KB
testcase_12 AC 128 ms
56,056 KB
testcase_13 AC 131 ms
55,468 KB
testcase_14 AC 130 ms
55,700 KB
testcase_15 AC 135 ms
55,788 KB
testcase_16 AC 121 ms
56,092 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
class C{
	static Scanner s = new Scanner(System.in);
	public static void main(String[] args){
		int in=s.nextInt()*s.nextInt();
		s.next();
		while(s.hasNext()) {
			in-=s.nextInt();
		}
		if(in>=0)
			System.out.println(in);
		else
			System.out.println(-1);
	}
}
0