結果

問題 No.1015 おつりは要らないです
コンテスト
ユーザー ryusuke
提出日時 2022-08-30 22:35:41
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 467 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 68 ms
コンパイル使用メモリ 82,544 KB
実行使用メモリ 88,992 KB
最終ジャッジ日時 2026-09-20 17:17:58
合計ジャッジ時間 8,018 ms
ジャッジサーバーID
(参考情報)
judge4_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 5 WA * 1 TLE * 1 -- * 26
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

# verification-helper: PROBLEM https://yukicoder.me/problems/no/1015

n, x, y, z = map(int, input().split())
a = list(map(int, input().split()))
for i in range(n):
    while a[i] > 0:
        if a[i] > 5000 and z >= 1:
            a[i] -= 10000
            z -= 1
        elif a[i] > 1000 and y >= 1:
            a[i] -= 5000
            y -= 1
        elif x >= 1:
            a[i] -= 1000
            x -= 1
        else:
            exit(print('No'))

print('Yes')
0