結果

問題 No.143 豆
ユーザー nemunemunemunemu
提出日時 2024-01-08 08:51:28
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 290 bytes
コンパイル時間 419 ms
コンパイル使用メモリ 63,224 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-27 19:35:23
合計ジャッジ時間 1,012 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

// No.143 豆
#include <iostream>
using namespace std;

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