結果

問題 No.143 豆
ユーザー YOSHIYOSHI
提出日時 2021-03-02 18:47:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 71 ms / 1,000 ms
コード長 533 bytes
コンパイル時間 4,424 ms
コンパイル使用メモリ 80,588 KB
実行使用メモリ 51,388 KB
最終ジャッジ日時 2024-04-14 04:47:57
合計ジャッジ時間 6,129 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
51,212 KB
testcase_01 AC 67 ms
51,240 KB
testcase_02 AC 71 ms
51,240 KB
testcase_03 AC 68 ms
51,316 KB
testcase_04 AC 68 ms
51,156 KB
testcase_05 AC 66 ms
51,312 KB
testcase_06 AC 66 ms
51,096 KB
testcase_07 AC 66 ms
51,180 KB
testcase_08 AC 68 ms
51,324 KB
testcase_09 AC 67 ms
51,168 KB
testcase_10 AC 66 ms
51,096 KB
testcase_11 AC 68 ms
51,092 KB
testcase_12 AC 66 ms
51,248 KB
testcase_13 AC 68 ms
51,388 KB
testcase_14 AC 67 ms
50,884 KB
testcase_15 AC 68 ms
51,100 KB
testcase_16 AC 67 ms
51,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class No00000143_Main {

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int[] arr = Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
		int zan = arr[0] * arr[1] - Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).sum();
		System.out.println(zan < 0 ? -1 : zan);
	}
}
0