結果

問題 No.143 豆
ユーザー jimanojimano
提出日時 2015-10-13 23:13:26
言語 Java21
(openjdk 21)
結果
AC  
実行時間 147 ms / 1,000 ms
コード長 386 bytes
コンパイル時間 3,591 ms
コンパイル使用メモリ 72,380 KB
実行使用メモリ 55,996 KB
最終ジャッジ日時 2023-09-30 16:38:53
合計ジャッジ時間 7,034 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
55,732 KB
testcase_01 AC 141 ms
55,684 KB
testcase_02 AC 140 ms
55,708 KB
testcase_03 AC 142 ms
55,724 KB
testcase_04 AC 141 ms
55,996 KB
testcase_05 AC 142 ms
55,772 KB
testcase_06 AC 143 ms
55,748 KB
testcase_07 AC 144 ms
55,496 KB
testcase_08 AC 143 ms
55,500 KB
testcase_09 AC 147 ms
55,820 KB
testcase_10 AC 145 ms
55,868 KB
testcase_11 AC 141 ms
55,696 KB
testcase_12 AC 140 ms
55,756 KB
testcase_13 AC 143 ms
55,764 KB
testcase_14 AC 142 ms
55,892 KB
testcase_15 AC 145 ms
55,880 KB
testcase_16 AC 134 ms
55,956 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