結果
| 問題 | No.143 豆 |
| コンテスト | |
| ユーザー |
ty70
|
| 提出日時 | 2016-10-25 01:40:07 |
| 言語 | C++11 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| + 416µs | |
| コード長 | 447 bytes |
| 記録 | |
| コンパイル時間 | 857 ms |
| コンパイル使用メモリ | 176,016 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-08-23 23:42:16 |
| 合計ジャッジ時間 | 2,696 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int N, K, F; cin >> N >> K >> F;
vector<int> A(F, 0);
rep (i, F) cin >> A[i];
int sum = accumulate(ALL(A), 0);
if (sum <= N*K){
cout << N*K - sum << endl;
}else{
cout << -1 << endl;
} // end if
return 0;
}
ty70