結果
| 問題 | No.143 豆 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-09-05 21:34:45 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 506 bytes |
| 記録 | |
| コンパイル時間 | 1,862 ms |
| コンパイル使用メモリ | 167,984 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-13 03:26:34 |
| 合計ジャッジ時間 | 4,056 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 9 RE * 8 |
ソースコード
/**
@file 143.cpp
@title No.143 豆 - yukicoder
@url https://yukicoder.me/problems/no/143
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, N) for (int i = 0; i < (N); ++i)
int main() {
int K, N, F;
cin >> K >> N >> F;
vector<int> A(N, 0);
LL ans = K * N;
REP(i, F) {
cin >> A[i];
ans -= A[i];
}
if (ans < 0) {
cout << "-1" << endl;
} else {
cout << ans << endl;
}
return 0;
}