結果

問題 No.143 豆
ユーザー mits58mits58
提出日時 2016-05-05 14:17:12
言語 Java21
(openjdk 21)
結果
AC  
実行時間 139 ms / 1,000 ms
コード長 349 bytes
コンパイル時間 2,048 ms
コンパイル使用メモリ 71,660 KB
実行使用メモリ 56,068 KB
最終ジャッジ日時 2023-09-30 16:45:20
合計ジャッジ時間 5,356 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
55,480 KB
testcase_01 AC 136 ms
55,724 KB
testcase_02 AC 135 ms
55,660 KB
testcase_03 AC 136 ms
55,936 KB
testcase_04 AC 135 ms
55,396 KB
testcase_05 AC 139 ms
55,820 KB
testcase_06 AC 137 ms
55,448 KB
testcase_07 AC 137 ms
55,436 KB
testcase_08 AC 137 ms
55,656 KB
testcase_09 AC 137 ms
55,700 KB
testcase_10 AC 136 ms
55,668 KB
testcase_11 AC 135 ms
55,720 KB
testcase_12 AC 130 ms
55,716 KB
testcase_13 AC 135 ms
55,356 KB
testcase_14 AC 137 ms
55,824 KB
testcase_15 AC 137 ms
56,068 KB
testcase_16 AC 127 ms
55,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        while(sc.hasNext()){
        	int sum=sc.nextInt()*sc.nextInt();
        	int f=sc.nextInt();
        	for(int i=0;i<f;i++) sum-=sc.nextInt();
        	System.out.println(Math.max(sum, -1));
        }
    }
}
0