結果
問題 |
No.143 豆
|
ユーザー |
|
提出日時 | 2020-06-14 23:23:04 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 418 bytes |
コンパイル時間 | 1,663 ms |
コンパイル使用メモリ | 167,728 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-28 02:21:16 |
合計ジャッジ時間 | 3,327 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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; }