結果
| 問題 | No.143 豆 |
| コンテスト | |
| ユーザー |
AQUA16573837
|
| 提出日時 | 2018-03-13 00:45:06 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 326 bytes |
| 記録 | |
| コンパイル時間 | 315 ms |
| コンパイル使用メモリ | 55,544 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-03 13:58:36 |
| 合計ジャッジ時間 | 820 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 |
ソースコード
#include <stdio.h>
#include <algorithm>
#include <deque>
using namespace std;
using ll = long long;
//143
int main() {
int k, n, f, a, total = 0;
scanf("%d %d %d", &k, &n, &f);
for (int i = 0; i < f; i++) {
scanf("%d", &a);
total += a;
}
if (total <= k * n)
printf("%d\n", k * n - total);
else
printf("-1\n");
}
AQUA16573837