結果

問題 No.143 豆
ユーザー packer_jppacker_jp
提出日時 2017-01-21 19:07:00
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 448 bytes
コンパイル時間 3,257 ms
コンパイル使用メモリ 72,664 KB
実行使用メモリ 57,632 KB
最終ジャッジ日時 2023-08-24 19:21:17
合計ジャッジ時間 6,466 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
57,632 KB
testcase_01 AC 128 ms
56,396 KB
testcase_02 AC 126 ms
55,780 KB
testcase_03 AC 128 ms
56,144 KB
testcase_04 AC 127 ms
55,648 KB
testcase_05 AC 129 ms
55,488 KB
testcase_06 AC 128 ms
56,036 KB
testcase_07 AC 129 ms
53,820 KB
testcase_08 AC 130 ms
55,616 KB
testcase_09 WA -
testcase_10 AC 129 ms
56,168 KB
testcase_11 AC 126 ms
55,892 KB
testcase_12 AC 129 ms
56,028 KB
testcase_13 AC 134 ms
56,092 KB
testcase_14 AC 132 ms
56,276 KB
testcase_15 AC 132 ms
56,260 KB
testcase_16 AC 122 ms
56,000 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