結果

問題 No.143 豆
ユーザー aaaaaaiu
提出日時 2019-07-26 19:40:33
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 1,000 ms
コード長 299 bytes
コンパイル時間 2,192 ms
コンパイル使用メモリ 193,172 KB
最終ジャッジ日時 2025-01-07 07:37:04
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    int k, n, f;
    cin >> k >> n >> f;
    int tot = k*n;
    for (int i = 0; i < f; i++) {
        int a; cin >> a;
        tot -= a;
    }
    if (tot < 0) puts("-1");
    else cout << tot << endl;
    return 0;
}
0