結果
| 問題 | No.143 豆 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-12-24 23:25:33 |
| 言語 | Java (openjdk 26.0.2.1) |
| 結果 |
AC
|
| 実行時間 | 39 ms / 1,000 ms |
| + 889µs | |
| コード長 | 582 bytes |
| 記録 | |
| コンパイル時間 | 1,668 ms |
| コンパイル使用メモリ | 87,212 KB |
| 実行使用メモリ | 41,164 KB |
| 最終ジャッジ日時 | 2026-08-24 00:57:40 |
| 合計ジャッジ時間 | 4,078 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 |
ソースコード
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.stream.Stream;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//K N F
int[] teisu = Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
int count = teisu[0] * teisu[1];
//年齢
int sum = Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).sum();
System.out.println((count - sum) >= 0 ? count - sum : "-1");
}
}