結果

問題 No.143 豆
ユーザー juger_jvjuger_jv
提出日時 2016-05-02 20:55:43
言語 Java21
(openjdk 21)
結果
AC  
実行時間 47 ms / 1,000 ms
コード長 488 bytes
コンパイル時間 2,108 ms
コンパイル使用メモリ 72,152 KB
実行使用メモリ 49,588 KB
最終ジャッジ日時 2023-09-30 16:45:07
合計ジャッジ時間 3,563 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
49,284 KB
testcase_01 AC 44 ms
49,588 KB
testcase_02 AC 47 ms
49,236 KB
testcase_03 AC 45 ms
47,800 KB
testcase_04 AC 44 ms
49,308 KB
testcase_05 AC 44 ms
49,156 KB
testcase_06 AC 44 ms
49,292 KB
testcase_07 AC 45 ms
49,248 KB
testcase_08 AC 45 ms
49,164 KB
testcase_09 AC 44 ms
49,296 KB
testcase_10 AC 45 ms
49,344 KB
testcase_11 AC 45 ms
49,184 KB
testcase_12 AC 45 ms
49,360 KB
testcase_13 AC 45 ms
49,384 KB
testcase_14 AC 47 ms
49,224 KB
testcase_15 AC 45 ms
49,176 KB
testcase_16 AC 45 ms
49,232 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