結果

問題 No.143 豆
ユーザー tentententen
提出日時 2020-11-10 16:48:40
言語 Java21
(openjdk 21)
結果
AC  
実行時間 133 ms / 1,000 ms
コード長 344 bytes
コンパイル時間 2,369 ms
コンパイル使用メモリ 71,896 KB
実行使用メモリ 56,360 KB
最終ジャッジ日時 2023-09-30 17:58:15
合計ジャッジ時間 5,466 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
56,360 KB
testcase_01 AC 130 ms
55,876 KB
testcase_02 AC 128 ms
55,684 KB
testcase_03 AC 130 ms
55,556 KB
testcase_04 AC 131 ms
56,048 KB
testcase_05 AC 132 ms
55,900 KB
testcase_06 AC 132 ms
55,680 KB
testcase_07 AC 131 ms
55,848 KB
testcase_08 AC 131 ms
56,292 KB
testcase_09 AC 131 ms
55,936 KB
testcase_10 AC 131 ms
55,452 KB
testcase_11 AC 126 ms
55,584 KB
testcase_12 AC 130 ms
55,684 KB
testcase_13 AC 131 ms
55,984 KB
testcase_14 AC 132 ms
55,876 KB
testcase_15 AC 133 ms
55,848 KB
testcase_16 AC 122 ms
55,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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