結果

問題 No.143 豆
ユーザー ui_mtc
提出日時 2020-03-30 21:51:07
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 1,000 ms
コード長 309 bytes
コンパイル時間 1,556 ms
コンパイル使用メモリ 167,076 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-23 11:28:39
合計ジャッジ時間 2,190 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define int long long 
using namespace std;
using Graph = vector<vector<int>>;

signed main(){
  int K, N, F;
  cin >> K >> N >> F;
  
  int B = K*N;
  for( int i = 0; i < F; i++ ){
    int A;
    cin >> A;
    B -= A;
  }
  if( B < 0 ) cout << -1 << endl;
  else cout << B << endl;
}
0