結果

問題 No.143 豆
ユーザー yuuki121yuuki121
提出日時 2020-12-24 23:30:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 66 ms / 1,000 ms
コード長 568 bytes
コンパイル時間 2,485 ms
コンパイル使用メモリ 74,728 KB
実行使用メモリ 50,676 KB
最終ジャッジ日時 2023-09-30 18:00:21
合計ジャッジ時間 4,454 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
50,672 KB
testcase_01 AC 66 ms
50,676 KB
testcase_02 AC 63 ms
48,668 KB
testcase_03 AC 62 ms
50,456 KB
testcase_04 AC 62 ms
50,616 KB
testcase_05 AC 62 ms
50,564 KB
testcase_06 AC 63 ms
50,472 KB
testcase_07 AC 62 ms
50,620 KB
testcase_08 AC 62 ms
50,460 KB
testcase_09 AC 63 ms
50,584 KB
testcase_10 AC 63 ms
50,656 KB
testcase_11 AC 62 ms
50,608 KB
testcase_12 AC 62 ms
50,620 KB
testcase_13 AC 62 ms
50,536 KB
testcase_14 AC 63 ms
50,576 KB
testcase_15 AC 65 ms
50,632 KB
testcase_16 AC 64 ms
50,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.stream.Stream;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		//K N F
		int[] teisu = Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
		int count = teisu[0] * teisu[1];
		//年齢
		int sum = Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).sum();

		System.out.println(Math.max(-1, count - sum));
	}
}
0