結果

問題 No.1015 おつりは要らないです
コンテスト
ユーザー near12
提出日時 2020-04-03 21:39:08
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 470 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 570 ms
コンパイル使用メモリ 20,696 KB
実行使用メモリ 25,232 KB
最終ジャッジ日時 2026-03-24 09:01:53
合計ジャッジ時間 8,414 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 11 WA * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n, x, y, z = map(int, input().split())
a = sorted(map(int, input().split()))

ans = 'Yes'
for i in a:
    if i // 10000 > 0 and z:
        num = min(i // 10000, z)
        z -= num
        i -= 10000 * num
    if i // 5000 > 0 and y:
        num = min(i // 5000, y)
        y -= num
        i -= 5000 * num
    if i // 1000 > 0 and x:
        num = min(i // 1000, x)
        y -= num
        i -= 1000 * num
    if i > 0 or x + y + z <= 0:
        ans = 'No'
print(ans)
0