結果
| 問題 |
No.143 豆
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-06-14 23:21:59 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 416 bytes |
| コンパイル時間 | 1,643 ms |
| コンパイル使用メモリ | 167,700 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-28 02:19:52 |
| 合計ジャッジ時間 | 3,575 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 9 RE * 8 |
ソースコード
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 1; i <= (n); i++)
using namespace std;
typedef long long ll;
int main(){
int k, n, f;
cin >> k >> n >> f;
vector<int> a(n);
rep(i ,f) cin >> a[i];
int total = k * n;
rep(i, f){
total -= a[i];
if(total < 0){
cout << -1 << endl;
return 0;
}
}
cout << total << endl;
return 0;
}