結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
50,672 KB
testcase_01 AC 63 ms
50,740 KB
testcase_02 AC 62 ms
50,712 KB
testcase_03 AC 64 ms
50,664 KB
testcase_04 AC 64 ms
50,480 KB
testcase_05 AC 65 ms
50,768 KB
testcase_06 AC 62 ms
50,616 KB
testcase_07 AC 63 ms
50,692 KB
testcase_08 AC 64 ms
50,552 KB
testcase_09 AC 62 ms
50,532 KB
testcase_10 AC 62 ms
50,700 KB
testcase_11 AC 61 ms
50,616 KB
testcase_12 AC 61 ms
50,616 KB
testcase_13 AC 61 ms
50,792 KB
testcase_14 AC 60 ms
50,604 KB
testcase_15 AC 63 ms
50,656 KB
testcase_16 AC 63 ms
50,644 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((count - sum) >= 0 ? count - sum : "-1");
	}
}
0