結果

問題 No.143 豆
ユーザー ikawaiikawai
提出日時 2023-09-04 14:39:07
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 434 bytes
コンパイル時間 4,355 ms
コンパイル使用メモリ 70,836 KB
実行使用メモリ 56,236 KB
最終ジャッジ日時 2023-09-04 14:39:16
合計ジャッジ時間 5,890 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,876 KB
testcase_01 AC 134 ms
55,796 KB
testcase_02 AC 132 ms
55,916 KB
testcase_03 AC 132 ms
55,788 KB
testcase_04 AC 131 ms
56,124 KB
testcase_05 AC 132 ms
55,868 KB
testcase_06 AC 132 ms
53,624 KB
testcase_07 AC 134 ms
56,052 KB
testcase_08 AC 132 ms
55,980 KB
testcase_09 WA -
testcase_10 AC 132 ms
56,068 KB
testcase_11 AC 128 ms
55,996 KB
testcase_12 AC 131 ms
55,688 KB
testcase_13 AC 134 ms
55,656 KB
testcase_14 AC 134 ms
55,732 KB
testcase_15 AC 134 ms
56,236 KB
testcase_16 AC 125 ms
55,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Wandbox
{
    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();
    	} 
    	if (ans > 0) {
    		System.out.println(ans);
    	} else {
    		System.out.println(-1);
    	}
    	
    }
}
0