結果

問題 No.1015 おつりは要らないです
ユーザー ryusuke
提出日時 2022-08-30 22:35:41
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 467 bytes
コンパイル時間 454 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 90,624 KB
最終ジャッジ日時 2024-11-07 16:12:06
合計ジャッジ時間 5,497 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 5 WA * 1 TLE * 1 -- * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

# 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