結果

問題 No.143 豆
ユーザー juger_jv
提出日時 2016-05-02 20:55:02
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 487 bytes
コンパイル時間 2,485 ms
コンパイル使用メモリ 74,684 KB
実行使用メモリ 50,264 KB
最終ジャッジ日時 2024-10-05 02:22:00
合計ジャッジ時間 3,346 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16 WA * 1
権限があれば一括ダウンロードができます

ソースコード

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