結果
| 問題 |
No.143 豆
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-05-09 11:56:20 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 335 bytes |
| コンパイル時間 | 443 ms |
| コンパイル使用メモリ | 56,476 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-23 10:58:52 |
| 合計ジャッジ時間 | 1,123 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 |
ソースコード
#include <iostream>
#include <vector>
using namespace std;
int main(int argc, char const* argv[]) {
int k, n, f, total;
cin >> k >> n >> f;
total = k * n;
int a;
for (int i = 0; i < f; i++) {
cin >> a;
total -= a;
}
if (total < 0) total = -1;
cout << total << endl;
return 0;
}