結果

問題 No.143 豆
ユーザー jimanojimano
提出日時 2015-10-13 23:09:52
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 385 bytes
コンパイル時間 3,399 ms
コンパイル使用メモリ 71,596 KB
実行使用メモリ 56,004 KB
最終ジャッジ日時 2023-09-28 13:01:50
合計ジャッジ時間 6,737 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
39,676 KB
testcase_01 AC 133 ms
39,184 KB
testcase_02 AC 131 ms
39,448 KB
testcase_03 AC 135 ms
39,840 KB
testcase_04 AC 134 ms
39,580 KB
testcase_05 AC 133 ms
39,408 KB
testcase_06 AC 136 ms
39,232 KB
testcase_07 AC 135 ms
39,520 KB
testcase_08 AC 135 ms
39,792 KB
testcase_09 WA -
testcase_10 AC 134 ms
39,256 KB
testcase_11 AC 135 ms
39,832 KB
testcase_12 AC 140 ms
39,484 KB
testcase_13 AC 136 ms
39,584 KB
testcase_14 AC 137 ms
40,120 KB
testcase_15 AC 137 ms
39,788 KB
testcase_16 AC 130 ms
39,612 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No143 {
	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[] age = new int[f];
		int i = 0;

		for(int j = 0; j < age.length ; j++){
			age[j] = sc.nextInt();
			i += age[j];
		}
		System.out.println( (k * n > i) ? k * n - i : -1 );
	}
}
0