結果
問題 | No.143 豆 |
ユーザー |
![]() |
提出日時 | 2016-05-02 20:55:43 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 56 ms / 1,000 ms |
コード長 | 488 bytes |
コンパイル時間 | 2,119 ms |
コンパイル使用メモリ | 74,316 KB |
実行使用メモリ | 50,392 KB |
最終ジャッジ日時 | 2024-07-23 10:29:49 |
合計ジャッジ時間 | 3,769 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 |
ソースコード
import java.io.*; class no143 { public static void main(String args[])throws IOException { BufferedReader sc=new BufferedReader(new InputStreamReader(System.in)); String knf[]=sc.readLine().split(" "); String a[]=sc.readLine().split(" "); int k,n,f,req=0; k=Integer.parseInt(knf[0]); n=Integer.parseInt(knf[1]); f=Integer.parseInt(knf[2]); for(int i=0;i<f;i++)req+=Integer.parseInt(a[i]); if(k*n-req>=0)System.out.println(k*n-req); else System.out.println(-1); } }