結果

問題 No.143 豆
ユーザー FpmpAmpmFpmpAmpm
提出日時 2016-10-21 22:56:43
言語 Java21
(openjdk 21)
結果
AC  
実行時間 135 ms / 1,000 ms
コード長 524 bytes
コンパイル時間 1,934 ms
コンパイル使用メモリ 71,612 KB
実行使用メモリ 57,864 KB
最終ジャッジ日時 2023-09-30 16:52:51
合計ジャッジ時間 5,053 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,800 KB
testcase_01 AC 132 ms
55,660 KB
testcase_02 AC 129 ms
55,716 KB
testcase_03 AC 129 ms
55,916 KB
testcase_04 AC 132 ms
55,580 KB
testcase_05 AC 131 ms
57,864 KB
testcase_06 AC 132 ms
55,692 KB
testcase_07 AC 134 ms
55,836 KB
testcase_08 AC 132 ms
55,872 KB
testcase_09 AC 132 ms
55,900 KB
testcase_10 AC 132 ms
55,848 KB
testcase_11 AC 129 ms
55,848 KB
testcase_12 AC 131 ms
55,600 KB
testcase_13 AC 134 ms
55,912 KB
testcase_14 AC 134 ms
56,140 KB
testcase_15 AC 135 ms
55,968 KB
testcase_16 AC 124 ms
55,620 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		Scanner sc = new Scanner(System.in);
    	int K = sc.nextInt();
    	int N = sc.nextInt();
    	// 人数
    	int F = sc.nextInt();
    	
    	int sum = 0;
    	
    	for (int i=0;i < F;i++) {
    		 sum += sc.nextInt();	
    	}
    	System.out.println((0 <= K * N - sum) ? K * N - sum : -1);
	}
}
0