結果
問題 | No.143 豆 |
ユーザー |
|
提出日時 | 2016-03-10 13:50:18 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 274 bytes |
コンパイル時間 | 428 ms |
コンパイル使用メモリ | 55,760 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-23 10:26:58 |
合計ジャッジ時間 | 1,035 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 |
ソースコード
#include <iostream> int main() { int k, n, f; std::cin >> k >> n >> f; int amount = k * n; for (; f > 0; --f) { int a; std::cin >> a; amount -= a; } if (amount >= 0) { std::cout << amount; } else { std::cout << -1; } std::cout << std::endl; return 0; }