結果

問題 No.1015 おつりは要らないです
ユーザー neterukun
提出日時 2020-04-03 21:50:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 475 bytes
コンパイル時間 156 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 90,228 KB
最終ジャッジ日時 2024-07-03 02:10:13
合計ジャッジ時間 3,713 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20 WA * 12 RE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

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

for i in range(n):
    res = -((-a[i] - 1) // 1000)
    y10 = res // 10
    res -= min(y10, z) * 10
    z -= min(y10, z)
    
    y5 = res // 5
    res -= min(y5, y) * 5
    y -= min(y5, y)
    
    a[i] = res

a = sorted(a, reverse=True)
for i in range(z):
    a[i] = 0
z = 0

a = sorted(a, reverse=True)
for i in range(y):
    a[i] = 0
y = 0

if sum(a) <= x:
    print("Yes")
else:
    print("No")
0