結果

問題 No.143 豆
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-09 14:00:32
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 341 bytes
コンパイル時間 2,427 ms
コンパイル使用メモリ 74,840 KB
実行使用メモリ 41,776 KB
最終ジャッジ日時 2024-04-16 01:10:54
合計ジャッジ時間 5,389 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 145 ms
41,776 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 143 ms
41,300 KB
testcase_06 AC 141 ms
41,280 KB
testcase_07 AC 144 ms
41,592 KB
testcase_08 AC 145 ms
41,648 KB
testcase_09 WA -
testcase_10 AC 147 ms
41,292 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
権限があれば一括ダウンロードができます

ソースコード

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