結果

問題 No.143 豆
ユーザー omc-testomc-test
提出日時 2016-08-04 14:28:25
言語 Java21
(openjdk 21)
結果
AC  
実行時間 139 ms / 1,000 ms
コード長 325 bytes
コンパイル時間 3,907 ms
コンパイル使用メモリ 71,484 KB
実行使用メモリ 55,996 KB
最終ジャッジ日時 2023-09-30 16:49:19
合計ジャッジ時間 7,214 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,800 KB
testcase_01 AC 134 ms
55,912 KB
testcase_02 AC 133 ms
55,756 KB
testcase_03 AC 134 ms
55,700 KB
testcase_04 AC 135 ms
55,808 KB
testcase_05 AC 128 ms
55,872 KB
testcase_06 AC 132 ms
55,660 KB
testcase_07 AC 126 ms
55,696 KB
testcase_08 AC 137 ms
55,508 KB
testcase_09 AC 136 ms
55,476 KB
testcase_10 AC 137 ms
55,552 KB
testcase_11 AC 130 ms
55,900 KB
testcase_12 AC 133 ms
55,540 KB
testcase_13 AC 135 ms
55,896 KB
testcase_14 AC 139 ms
55,612 KB
testcase_15 AC 138 ms
55,704 KB
testcase_16 AC 133 ms
55,996 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class No0143 {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int sum = sc.nextInt() * sc.nextInt();
		int f = sc.nextInt();
		for(int i=0; i<f; i++){
			sum -= sc.nextInt();
			if(sum < 0){
				sum = -1;
				break;
			}
		}
		System.out.println(sum);
		}
}
0