結果
| 問題 |
No.143 豆
|
| コンテスト | |
| ユーザー |
xvfz57
|
| 提出日時 | 2019-10-26 23:18:04 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 390 bytes |
| コンパイル時間 | 461 ms |
| コンパイル使用メモリ | 62,484 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-23 11:21:30 |
| 合計ジャッジ時間 | 1,099 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 |
ソースコード
#include <iostream>
#include <algorithm>
#include <vector>
#include <numeric>
using namespace std;
int main(){
int k, n, f, age, sum;
cin>>k>>n>>f;
vector<int> age_v;
for (int i=0;i<f;i++){
cin >> age;
age_v.push_back(age);
}
sum = accumulate(age_v.begin(), age_v.end(), 0);
if (k * n >= sum){
cout << k * n - sum << endl;
}else{
cout << -1 << endl;
}
}
xvfz57