結果
問題 |
No.143 豆
|
ユーザー |
![]() |
提出日時 | 2016-08-07 21:31:21 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 426 bytes |
コンパイル時間 | 460 ms |
コンパイル使用メモリ | 54,012 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-07 09:51:21 |
合計ジャッジ時間 | 1,294 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 WA * 1 |
ソースコード
#include <iostream> using namespace std; int main() { int bean_num, bag_num, fam_num; int *olds; int olds_sum = 0; cin >> bean_num >> bag_num >> fam_num; olds = new int[fam_num]; for (int i = 0; i < fam_num; i++) { cin >> olds[i]; olds_sum += olds[i]; } if (olds_sum >= bean_num * bag_num) { cout << -1 << endl; } else { cout << (bean_num * bag_num) - olds_sum << endl; } delete[] olds; return 0; }