結果

問題 No.1015 おつりは要らないです
ユーザー neterukunneterukun
提出日時 2020-04-03 21:50:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 475 bytes
コンパイル時間 309 ms
コンパイル使用メモリ 87,104 KB
実行使用メモリ 93,840 KB
最終ジャッジ日時 2023-09-16 01:03:53
合計ジャッジ時間 5,589 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,288 KB
testcase_01 AC 70 ms
71,308 KB
testcase_02 AC 71 ms
71,068 KB
testcase_03 AC 69 ms
71,192 KB
testcase_04 AC 70 ms
71,360 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 69 ms
71,276 KB
testcase_08 AC 70 ms
71,416 KB
testcase_09 AC 69 ms
71,220 KB
testcase_10 AC 115 ms
93,196 KB
testcase_11 AC 115 ms
92,168 KB
testcase_12 AC 115 ms
93,792 KB
testcase_13 AC 115 ms
93,280 KB
testcase_14 AC 116 ms
92,404 KB
testcase_15 AC 114 ms
93,660 KB
testcase_16 AC 114 ms
93,212 KB
testcase_17 AC 114 ms
92,360 KB
testcase_18 AC 115 ms
93,720 KB
testcase_19 AC 113 ms
93,840 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 69 ms
71,128 KB
testcase_31 AC 94 ms
90,940 KB
testcase_32 AC 93 ms
90,688 KB
testcase_33 AC 109 ms
91,884 KB
testcase_34 AC 69 ms
70,972 KB
testcase_35 AC 70 ms
71,100 KB
testcase_36 RE -
権限があれば一括ダウンロードができます

ソースコード

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