結果

問題 No.143 豆
ユーザー dogwood0424
提出日時 2017-11-29 19:52:59
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 425 bytes
コンパイル時間 3,173 ms
コンパイル使用メモリ 74,284 KB
実行使用メモリ 41,524 KB
最終ジャッジ日時 2024-11-27 19:08:53
合計ジャッジ時間 6,039 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No143 {
	public static void main(String[]args) {
		Scanner sc = new Scanner(System.in);

		int K,N,F;
		K = sc.nextInt();
		N = sc.nextInt();
		F = sc.nextInt();

		int []a = new int[F];
		int B=0 ;

		for(int i=0;i<F;i++) {
			a[i] = sc.nextInt();
			B +=a[i];
		}

		int S ;
		S = K * N;

		if(S-B>0) {
			System.out.println(S-B);
		}
		else {
			System.out.println(-1);
		}


	}

}
0