結果

問題 No.1015 おつりは要らないです
コンテスト
ユーザー near12
提出日時 2020-04-03 21:39:08
言語 Python3
(3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 470 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 277 ms
コンパイル使用メモリ 21,412 KB
実行使用メモリ 26,132 KB
最終ジャッジ日時 2026-08-04 08:48:28
合計ジャッジ時間 8,831 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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