結果
問題 | No.143 豆 |
ユーザー |
|
提出日時 | 2020-12-24 23:25:33 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 71 ms / 1,000 ms |
コード長 | 582 bytes |
コンパイル時間 | 2,696 ms |
コンパイル使用メモリ | 79,836 KB |
実行使用メモリ | 51,328 KB |
最終ジャッジ日時 | 2024-07-23 11:40:11 |
合計ジャッジ時間 | 4,646 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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"); } }