結果

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

ソースコード

diff #

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <numeric>
#include <optional>
#include <vector>

using namespace std;

int main() {
    int32_t k, n, f;
    cin >> k >> n >> f;
    int32_t sum = 0;
    for (auto i = 0; i < f; ++i) {
        int32_t a;
        cin >> a;
        sum += a;
    }
    cout << max(k * n - sum, -1) << endl;
    return 0;
}
0