結果

問題 No.143 豆
ユーザー aa
提出日時 2016-04-25 16:41:24
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 667 bytes
コンパイル時間 3,216 ms
コンパイル使用メモリ 74,440 KB
実行使用メモリ 50,216 KB
最終ジャッジ日時 2024-04-15 04:26:51
合計ジャッジ時間 4,360 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 49 ms
49,948 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

public class Ex04 {
	public static void main(String[] args){

		int[] num = new int[3];

		for(int j=0; j<args.length; j++){
			num[j] = Integer.parseInt(args[j]);
		}
		
		int k = num[0];
		int n = num[1];
		int f = num[2];
		
		int sum = 0;
		int beans = 0;
		int result = 0;
		int[] a = new int[f];

		
		
		int[] nums = new int[f];

		for(int i=0; i<f; i++){
			nums[i] = Integer.parseInt(args[i]);
			sum += nums[i];
		}
		
		
		
		
		/*for(int i=4; i<f; i++){
			a[i-4] = Integer.parseInt(args[i]);
			sum += a[i-4];
		}*/

		beans = k * n;
		result = beans - sum;

		if(result<0){
			System.out.println("-1");
		}else{
			System.out.println(result);
		}

	}
}
0