結果

問題 No.1015 おつりは要らないです
ユーザー neterukun
提出日時 2020-04-03 21:58:58
言語 PyPy3
(7.3.15)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 515 bytes
コンパイル時間 436 ms
コンパイル使用メモリ 82,392 KB
実行使用メモリ 90,880 KB
最終ジャッジ日時 2024-11-17 23:10:21
合計ジャッジ時間 4,803 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 32 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)
    a[i] = res

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

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

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