結果

問題 No.143 豆
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-09 14:01:24
言語 Java21
(openjdk 21)
結果
AC  
実行時間 132 ms / 1,000 ms
コード長 341 bytes
コンパイル時間 4,404 ms
コンパイル使用メモリ 72,968 KB
実行使用メモリ 55,940 KB
最終ジャッジ日時 2023-09-30 17:12:00
合計ジャッジ時間 4,951 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,568 KB
testcase_01 AC 129 ms
55,752 KB
testcase_02 AC 126 ms
55,828 KB
testcase_03 AC 129 ms
55,712 KB
testcase_04 AC 129 ms
55,424 KB
testcase_05 AC 129 ms
55,832 KB
testcase_06 AC 130 ms
55,880 KB
testcase_07 AC 131 ms
55,692 KB
testcase_08 AC 131 ms
55,700 KB
testcase_09 AC 131 ms
55,844 KB
testcase_10 AC 131 ms
55,440 KB
testcase_11 AC 128 ms
55,940 KB
testcase_12 AC 127 ms
55,868 KB
testcase_13 AC 132 ms
55,804 KB
testcase_14 AC 130 ms
55,580 KB
testcase_15 AC 129 ms
55,808 KB
testcase_16 AC 120 ms
55,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int a = sc.nextInt();
		int b = sc.nextInt();
		int mame = a * b;
		int n = sc.nextInt();
		for (int i=0; i<n; i++) {
			int temp = sc.nextInt();
			mame -= temp;
		}
		System.out.println(mame<0?"-1":mame);
	}
}
0