結果

問題 No.143 豆
ユーザー FpmpAmpm
提出日時 2016-10-21 22:52:39
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 523 bytes
コンパイル時間 2,128 ms
コンパイル使用メモリ 75,120 KB
実行使用メモリ 54,052 KB
最終ジャッジ日時 2024-11-23 16:49:44
合計ジャッジ時間 5,494 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16 WA * 1
権限があれば一括ダウンロードができます

ソースコード

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