結果

問題 No.143 豆
ユーザー FpmpAmpmFpmpAmpm
提出日時 2016-10-21 22:52:39
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 523 bytes
コンパイル時間 2,268 ms
コンパイル使用メモリ 75,504 KB
実行使用メモリ 41,424 KB
最終ジャッジ日時 2024-05-02 22:03:01
合計ジャッジ時間 5,427 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
40,884 KB
testcase_01 AC 141 ms
41,160 KB
testcase_02 AC 138 ms
41,136 KB
testcase_03 AC 146 ms
41,244 KB
testcase_04 AC 151 ms
41,336 KB
testcase_05 AC 140 ms
41,088 KB
testcase_06 AC 140 ms
41,212 KB
testcase_07 AC 142 ms
41,044 KB
testcase_08 AC 142 ms
41,364 KB
testcase_09 WA -
testcase_10 AC 142 ms
41,216 KB
testcase_11 AC 138 ms
41,108 KB
testcase_12 AC 126 ms
40,428 KB
testcase_13 AC 141 ms
41,376 KB
testcase_14 AC 145 ms
41,340 KB
testcase_15 AC 149 ms
41,424 KB
testcase_16 AC 134 ms
41,100 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