結果

問題 No.143 豆
ユーザー Jojikkkkk
提出日時 2020-10-05 07:16:03
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 1,000 ms
コード長 276 bytes
コンパイル時間 489 ms
コンパイル使用メモリ 66,936 KB
最終ジャッジ日時 2025-01-15 02:51:03
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>

using namespace std;

int main(){

  int k,n,f,to=0,m;
  cin >> k >> n >> f;
  int a[f];

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

  m = k * n;

  if(m < to)
      cout << -1 << endl;
  else
    cout << m- to <<endl;

  return 0;
}
0