結果
問題 |
No.143 豆
|
ユーザー |
![]() |
提出日時 | 2020-01-16 19:50:48 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 373 bytes |
コンパイル時間 | 797 ms |
コンパイル使用メモリ | 63,104 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-23 11:24:07 |
合計ジャッジ時間 | 1,286 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 |
ソースコード
#include <iostream> using namespace std; int main() { int k, n, f; int input[100]; int ans = 0; int sum = 0; cin >> k >> n >> f; for (int i = 0; i < f; i++){ cin >> input[i]; sum += input[i]; } if (k * n >= sum){ cout << k * n - sum << "\n"; } else { cout << -1 << "\n"; } return 0; }