結果

問題 No.143 豆
ユーザー kou6839kou6839
提出日時 2015-02-06 16:12:03
言語 Java21
(openjdk 21)
結果
AC  
実行時間 135 ms / 1,000 ms
コード長 387 bytes
コンパイル時間 4,527 ms
コンパイル使用メモリ 71,604 KB
実行使用メモリ 57,496 KB
最終ジャッジ日時 2023-09-30 16:30:51
合計ジャッジ時間 5,054 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,384 KB
testcase_01 AC 131 ms
55,868 KB
testcase_02 AC 127 ms
56,016 KB
testcase_03 AC 128 ms
57,496 KB
testcase_04 AC 132 ms
56,176 KB
testcase_05 AC 130 ms
55,448 KB
testcase_06 AC 132 ms
55,840 KB
testcase_07 AC 133 ms
55,844 KB
testcase_08 AC 134 ms
55,692 KB
testcase_09 AC 135 ms
55,464 KB
testcase_10 AC 133 ms
56,056 KB
testcase_11 AC 128 ms
55,672 KB
testcase_12 AC 130 ms
55,432 KB
testcase_13 AC 132 ms
55,776 KB
testcase_14 AC 131 ms
56,036 KB
testcase_15 AC 132 ms
55,932 KB
testcase_16 AC 123 ms
55,700 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.math.*;
import java.util.*;

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