結果

問題 No.143 豆
ユーザー matsuyoshi30
提出日時 2016-02-04 12:57:44
言語 Java
(openjdk 23)
結果
RE  
実行時間 -
コード長 431 bytes
コンパイル時間 2,612 ms
コンパイル使用メモリ 73,980 KB
実行使用メモリ 41,644 KB
最終ジャッジ日時 2024-09-21 20:29:47
合計ジャッジ時間 4,752 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Test {
	public static void main(String[] args) throws Exception {
		Scanner in = new Scanner(System.in);
		int k = in.nextInt();
		int n = in.nextInt();
		int f = in.nextInt();

		int[] a = new int[f-1];
		int temp = 0;
		for(int i=0; i<f; i++) {
			a[i] = in.nextInt();
			temp += a[i];
		}

		if(k * n < temp) {
			System.out.println(-1);
		} else {
			System.out.println(k * n - temp);
		}
	}
}
0