結果

問題 No.143 豆
ユーザー mikan765mikan765
提出日時 2017-07-05 12:38:14
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 372 bytes
コンパイル時間 2,327 ms
コンパイル使用メモリ 74,508 KB
実行使用メモリ 54,512 KB
最終ジャッジ日時 2024-04-15 18:10:34
合計ジャッジ時間 5,354 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
54,460 KB
testcase_01 AC 134 ms
54,092 KB
testcase_02 AC 131 ms
53,836 KB
testcase_03 AC 131 ms
54,420 KB
testcase_04 AC 134 ms
54,168 KB
testcase_05 AC 133 ms
54,472 KB
testcase_06 AC 138 ms
54,512 KB
testcase_07 AC 134 ms
54,268 KB
testcase_08 AC 134 ms
54,104 KB
testcase_09 WA -
testcase_10 AC 131 ms
54,232 KB
testcase_11 AC 131 ms
54,016 KB
testcase_12 AC 119 ms
53,072 KB
testcase_13 AC 130 ms
54,320 KB
testcase_14 AC 131 ms
54,036 KB
testcase_15 AC 133 ms
54,248 KB
testcase_16 AC 124 ms
54,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int k = sc.nextInt();
		int n = sc.nextInt();
		int mame = k*n;
		int f = sc.nextInt();
		int sum = 0;
		for(int i=0;i<f;i++){
			sum += sc.nextInt();
		}
		if(mame>sum){
			System.out.println(mame-sum);
		}else{
			System.out.println(-1);
		}
	}
}
0