結果

問題 No.143 豆
ユーザー カニ戯(ryカニ戯(ry
提出日時 2015-02-24 15:42:49
言語 Java19
(openjdk 21)
結果
AC  
実行時間 138 ms / 1,000 ms
コード長 245 bytes
コンパイル時間 1,976 ms
コンパイル使用メモリ 71,600 KB
実行使用メモリ 57,796 KB
最終ジャッジ日時 2023-09-30 16:32:00
合計ジャッジ時間 5,260 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,688 KB
testcase_01 AC 135 ms
55,428 KB
testcase_02 AC 132 ms
55,440 KB
testcase_03 AC 132 ms
55,676 KB
testcase_04 AC 134 ms
55,712 KB
testcase_05 AC 133 ms
55,840 KB
testcase_06 AC 134 ms
55,636 KB
testcase_07 AC 134 ms
55,556 KB
testcase_08 AC 134 ms
55,676 KB
testcase_09 AC 137 ms
55,676 KB
testcase_10 AC 137 ms
55,852 KB
testcase_11 AC 131 ms
57,472 KB
testcase_12 AC 134 ms
57,796 KB
testcase_13 AC 136 ms
55,716 KB
testcase_14 AC 137 ms
55,576 KB
testcase_15 AC 138 ms
55,568 KB
testcase_16 AC 125 ms
55,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] a) {
		Scanner s = new Scanner(System.in);
		int i=0,K=s.nextInt(),S=K*s.nextInt(),F=s.nextInt();
		for(;F>i++;)S-=s.nextInt();
		System.out.println(S<0?-1:S);
	}
}
0