結果
問題 |
No.143 豆
|
ユーザー |
|
提出日時 | 2018-05-11 21:41:32 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 594 bytes |
コンパイル時間 | 3,512 ms |
コンパイル使用メモリ | 74,552 KB |
実行使用メモリ | 41,600 KB |
最終ジャッジ日時 | 2024-06-28 04:02:34 |
合計ジャッジ時間 | 6,279 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 WA * 1 |
ソースコード
import java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Setsubun{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int K = sc.nextInt(); int N = sc.nextInt(); int num_beans = K*N; int F = sc.nextInt(); int num_eats = 0; for(int i = 0; i < F; i++){ num_eats += sc.nextInt(); } if(num_beans > num_eats){ System.out.println(num_beans - num_eats); }else{ System.out.println(-1); } } }