結果

問題 No.143 豆
ユーザー Mcpu3Mcpu3
提出日時 2018-06-22 01:00:11
言語 Java21
(openjdk 21)
結果
AC  
実行時間 136 ms / 1,000 ms
コード長 346 bytes
コンパイル時間 3,749 ms
コンパイル使用メモリ 72,056 KB
実行使用メモリ 57,728 KB
最終ジャッジ日時 2023-09-30 17:19:56
合計ジャッジ時間 5,726 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,764 KB
testcase_01 AC 134 ms
56,008 KB
testcase_02 AC 131 ms
55,820 KB
testcase_03 AC 133 ms
55,668 KB
testcase_04 AC 134 ms
56,336 KB
testcase_05 AC 133 ms
55,496 KB
testcase_06 AC 135 ms
55,960 KB
testcase_07 AC 134 ms
55,704 KB
testcase_08 AC 136 ms
57,728 KB
testcase_09 AC 133 ms
55,796 KB
testcase_10 AC 131 ms
55,476 KB
testcase_11 AC 133 ms
55,792 KB
testcase_12 AC 131 ms
55,900 KB
testcase_13 AC 135 ms
55,928 KB
testcase_14 AC 134 ms
56,084 KB
testcase_15 AC 135 ms
55,940 KB
testcase_16 AC 122 ms
55,712 KB
権限があれば一括ダウンロードができます

ソースコード

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