結果

問題 No.143 豆
ユーザー TatsuDX
提出日時 2016-09-08 23:55:04
言語 Java
(openjdk 23)
結果
AC  
実行時間 144 ms / 1,000 ms
コード長 331 bytes
コンパイル時間 3,332 ms
コンパイル使用メモリ 74,424 KB
実行使用メモリ 54,516 KB
最終ジャッジ日時 2024-07-23 10:36:14
合計ジャッジ時間 6,564 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Test {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int s = sc.nextInt() * sc.nextInt(), n = sc.nextInt();
		for (int i = 0; i < n; i++) {
			s -= sc.nextInt();
		}
		if (s < 0) {
			System.out.println(-1);
		} else {
			System.out.println(s);
		}
	}
}
0