結果

問題 No.143 豆
ユーザー Mcpu3
提出日時 2018-06-22 01:00:11
言語 Java
(openjdk 23)
結果
AC  
実行時間 139 ms / 1,000 ms
コード長 346 bytes
コンパイル時間 2,145 ms
コンパイル使用メモリ 76,036 KB
実行使用メモリ 44,228 KB
最終ジャッジ日時 2024-07-23 11:01:42
合計ジャッジ時間 4,927 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class no143{
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int k,n,f,a,i,s=0;
		k=stdIn.nextInt();
		n=stdIn.nextInt();
		f=stdIn.nextInt();
		for(i=0;i<f;i++) {
			a=stdIn.nextInt();
			s+=a;
		}
		f=k*n-s;
		if(f<0) i=-1;
		else i=f;
		System.out.print(i);
	}
}
0