結果

問題 No.143 豆
ユーザー jolly_gliscor
提出日時 2018-02-25 21:41:26
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 353 bytes
コンパイル時間 365 ms
コンパイル使用メモリ 55,948 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-17 01:59:27
合計ジャッジ時間 1,108 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdlib>

using std::cout;
using std::cin;
using std::endl;


int main(void)
{
  int k,n,f;
  cin >> k;
  cin >> n;
  cin >> f;

  int sum = 0;
  int old[f];
  for(int i=0;i<f;i++){
    cin >> old[i];
    sum += old[i];
  }

  if ( k*n > sum )
    cout << k*n - sum << endl;
  else
    cout << "-1" << endl;

  return 0;
}
0