結果

問題 No.143 豆
ユーザー 8130Tsk
提出日時 2015-07-24 21:51:11
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 408 bytes
コンパイル時間 4,127 ms
コンパイル使用メモリ 76,608 KB
実行使用メモリ 41,516 KB
最終ジャッジ日時 2024-07-08 13:05:35
合計ジャッジ時間 5,662 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No143 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int K = sc.nextInt();
		int N = sc.nextInt();
		int F = sc.nextInt();
		
		int sum=K*N;
		
		for(int i=0; i<F;i++){
			if(sum>=0){
				sum=sum-sc.nextInt();
			}else{
				System.out.println(-1);
			}
		}
		System.out.println(sum);
		
	}

}
0