結果
| 問題 |
No.143 豆
|
| コンテスト | |
| ユーザー |
Ronlynes
|
| 提出日時 | 2017-01-29 01:49:45 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 304 bytes |
| コンパイル時間 | 945 ms |
| コンパイル使用メモリ | 55,900 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-23 22:33:39 |
| 合計ジャッジ時間 | 1,220 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 WA * 11 |
ソースコード
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main() {
int k, n, f, sum, ans;
int a[101];
cin >> k >> n >> f;
for(int i=0;i<f;i++){
cin >> a[i];
sum += a[i];
}
if(k*n >= sum){
ans = k*n -sum;
}else{
ans = -1;
}
cout << ans << endl;
return 0;
}
Ronlynes