結果
問題 |
No.143 豆
|
ユーザー |
|
提出日時 | 2025-08-06 09:08:37 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 502 bytes |
コンパイル時間 | 967 ms |
コンパイル使用メモリ | 102,672 KB |
実行使用メモリ | 7,720 KB |
最終ジャッジ日時 | 2025-08-06 09:08:39 |
合計ジャッジ時間 | 1,856 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 |
ソースコード
#include <algorithm> #include <iostream> #include <iomanip> #include <climits> #include <string> #include <vector> #include <cmath> #include <set> #include <map> using namespace std; using ll = long long; int main(void) { int K, N, F; cin >> K >> N >> F; int Sum = K * N; int Old = 0; vector<int> A(F); for (int i = 0; i < F; i++) { cin >> A.at(i); Old += A.at(i); } if (Old > Sum) { cout << -1 << endl; } else { cout << Sum - Old << endl; } return 0; }