結果
| 問題 |
No.1015 おつりは要らないです
|
| コンテスト | |
| ユーザー |
sash2104
|
| 提出日時 | 2020-04-03 21:39:10 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 603 bytes |
| コンパイル時間 | 764 ms |
| コンパイル使用メモリ | 75,220 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-03 01:48:47 |
| 合計ジャッジ時間 | 2,961 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 15 WA * 18 |
ソースコード
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n, X, Y, Z; cin >> n >> X >> Y >> Z;
vector<int> la(n);
for (int i = 0; i < n; ++i) {
cin >> la[i];
}
sort(la.begin(), la.end(), greater<int>());
for (int a: la) {
int z = min(a/10000+1, Z);
a -= z*10000;
Z -= z;
if (a < 0) continue;
int y = min(a/5000+1,Y);
a -= y*5000;
Y -= y;
if (a < 0) continue;
int x = min(a/1000+1,X);
a -= x*5000;
X -= x;
if (a < 0) continue;
cout << "No" << endl;
return 0;
}
cout << "Yes" << endl;
}
sash2104