結果

問題 No.143 豆
ユーザー packer_jppacker_jp
提出日時 2017-01-21 19:09:47
言語 Java21
(openjdk 21)
結果
AC  
実行時間 146 ms / 1,000 ms
コード長 447 bytes
コンパイル時間 3,194 ms
コンパイル使用メモリ 71,892 KB
実行使用メモリ 56,060 KB
最終ジャッジ日時 2023-09-30 16:55:48
合計ジャッジ時間 6,492 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,660 KB
testcase_01 AC 133 ms
55,708 KB
testcase_02 AC 133 ms
55,956 KB
testcase_03 AC 133 ms
55,760 KB
testcase_04 AC 134 ms
53,680 KB
testcase_05 AC 136 ms
55,728 KB
testcase_06 AC 144 ms
55,676 KB
testcase_07 AC 139 ms
55,816 KB
testcase_08 AC 138 ms
54,060 KB
testcase_09 AC 146 ms
55,728 KB
testcase_10 AC 137 ms
55,920 KB
testcase_11 AC 136 ms
55,936 KB
testcase_12 AC 134 ms
55,476 KB
testcase_13 AC 136 ms
55,720 KB
testcase_14 AC 136 ms
55,608 KB
testcase_15 AC 138 ms
56,060 KB
testcase_16 AC 127 ms
55,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Practice {
    public static void main(String args[]){
        Scanner scanner=new Scanner(System.in);
        int K=scanner.nextInt(),N=scanner.nextInt(),F=scanner.nextInt();
        int Fsum=0;
        for(int i=0;i<F;i++){
            Fsum+=scanner.nextInt();
        }
        if(K*N-Fsum<0){
            System.out.println(-1);
        }else{
            System.out.println(K*N-Fsum);
        }
    }
}
0