結果
問題 | No.143 豆 |
ユーザー |
|
提出日時 | 2016-03-31 11:21:25 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 141 ms / 1,000 ms |
コード長 | 394 bytes |
コンパイル時間 | 2,059 ms |
コンパイル使用メモリ | 77,540 KB |
実行使用メモリ | 54,416 KB |
最終ジャッジ日時 | 2024-07-23 10:28:13 |
合計ジャッジ時間 | 5,017 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 |
ソースコード
package yukicoder143;import java.util.*;public class Main {public static void main(String[] args){Scanner sc=new Scanner(System.in);int k=sc.nextInt();//一袋K粒int n=sc.nextInt();//N袋int f=sc.nextInt();//家族人数int sum=0;for(int i=0;i<f;i++){sum+=sc.nextInt();}if(k*n>=sum){System.out.println(k*n-sum);}else{System.out.println(-1);}}}