結果

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

ソースコード

diff #

#include<iostream>
#include<vector>
using namespace std;
typedef long long ll;

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