結果

問題 No.143 豆
ユーザー juger_jvjuger_jv
提出日時 2016-05-02 20:55:02
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 487 bytes
コンパイル時間 2,509 ms
コンパイル使用メモリ 73,592 KB
実行使用メモリ 37,288 KB
最終ジャッジ日時 2024-04-15 09:19:30
合計ジャッジ時間 4,514 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
37,060 KB
testcase_01 AC 64 ms
37,076 KB
testcase_02 AC 64 ms
37,224 KB
testcase_03 AC 67 ms
36,764 KB
testcase_04 AC 66 ms
37,180 KB
testcase_05 AC 64 ms
37,064 KB
testcase_06 AC 59 ms
37,288 KB
testcase_07 AC 61 ms
37,224 KB
testcase_08 AC 66 ms
37,248 KB
testcase_09 WA -
testcase_10 AC 63 ms
37,028 KB
testcase_11 AC 61 ms
36,664 KB
testcase_12 AC 67 ms
37,032 KB
testcase_13 AC 64 ms
36,912 KB
testcase_14 AC 61 ms
37,224 KB
testcase_15 AC 70 ms
36,860 KB
testcase_16 AC 64 ms
37,020 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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);
 }
}
0