結果

問題 No.143 豆
ユーザー yu_017yu_017
提出日時 2019-01-16 23:50:20
言語 Java21
(openjdk 21)
結果
AC  
実行時間 137 ms / 1,000 ms
コード長 359 bytes
コンパイル時間 3,319 ms
コンパイル使用メモリ 72,836 KB
実行使用メモリ 56,120 KB
最終ジャッジ日時 2023-09-30 17:25:21
合計ジャッジ時間 6,661 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
55,896 KB
testcase_01 AC 135 ms
55,628 KB
testcase_02 AC 135 ms
55,980 KB
testcase_03 AC 131 ms
56,100 KB
testcase_04 AC 134 ms
55,808 KB
testcase_05 AC 133 ms
55,768 KB
testcase_06 AC 133 ms
55,772 KB
testcase_07 AC 137 ms
55,648 KB
testcase_08 AC 136 ms
55,772 KB
testcase_09 AC 134 ms
56,120 KB
testcase_10 AC 133 ms
55,712 KB
testcase_11 AC 131 ms
55,440 KB
testcase_12 AC 133 ms
55,632 KB
testcase_13 AC 135 ms
56,080 KB
testcase_14 AC 134 ms
55,648 KB
testcase_15 AC 136 ms
55,772 KB
testcase_16 AC 125 ms
55,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class A000143 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int k = sc.nextInt();
		int n = sc.nextInt();
		int f = sc.nextInt();
		int count = 0;
		for(int i=0;i<f;i++) {
			count += sc.nextInt();
		}
		int r = (k*n-count)>-1?k*n-count:-1;
		sc.close();

		System.out.println(r);
	}
}
0