結果

問題 No.143 豆
ユーザー Syl514Syl514
提出日時 2020-06-14 23:26:56
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 422 bytes
コンパイル時間 1,457 ms
コンパイル使用メモリ 165,944 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-10 11:03:17
合計ジャッジ時間 3,439 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 RE -
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 AC 2 ms
4,376 KB
testcase_12 RE -
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;

int main(){
    int k, n, f;
    cin >> k >> n >> f;
    vector<int> a(n);
    int sum = 0;
    rep(i ,f){ 
        cin >> a[i];
        sum += a[i];
    }
    int total = k * n;
    if(total - sum < 0){
        cout << -1 << endl;
    }else{
        cout << total - sum << endl;
    }    
    return 0;
}
0