結果

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

ソースコード

diff #

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

int main(){
    int k, n, f, i, sum;
    cin >> k >> n >> f;
    vector<int> v(f) ;
    for(i=0; i<f; i++)
        cin >> v.at(i);
    sum = accumulate(v.begin(), v.end(), 0);
    if (k*n >= sum)
        cout << k*n-sum << endl ;
    else
        cout << -1 << endl ;
    return 0;
}
0