結果

問題 No.1015 おつりは要らないです
ユーザー komkompikomkompi
提出日時 2023-11-04 10:10:35
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 606 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 81,884 KB
実行使用メモリ 90,724 KB
最終ジャッジ日時 2023-11-04 10:10:45
合計ジャッジ時間 8,119 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,624 KB
testcase_01 AC 39 ms
53,624 KB
testcase_02 AC 38 ms
53,624 KB
testcase_03 AC 39 ms
53,624 KB
testcase_04 AC 38 ms
53,624 KB
testcase_05 AC 39 ms
53,624 KB
testcase_06 AC 38 ms
53,624 KB
testcase_07 AC 39 ms
53,624 KB
testcase_08 AC 44 ms
53,624 KB
testcase_09 AC 39 ms
53,624 KB
testcase_10 AC 275 ms
90,220 KB
testcase_11 AC 269 ms
90,292 KB
testcase_12 AC 253 ms
90,124 KB
testcase_13 AC 262 ms
90,232 KB
testcase_14 AC 297 ms
90,340 KB
testcase_15 AC 260 ms
90,148 KB
testcase_16 AC 263 ms
90,220 KB
testcase_17 AC 269 ms
90,292 KB
testcase_18 AC 288 ms
90,208 KB
testcase_19 AC 261 ms
90,196 KB
testcase_20 AC 247 ms
90,016 KB
testcase_21 AC 243 ms
89,992 KB
testcase_22 AC 249 ms
89,992 KB
testcase_23 AC 271 ms
89,920 KB
testcase_24 AC 248 ms
90,040 KB
testcase_25 AC 251 ms
89,992 KB
testcase_26 AC 251 ms
89,992 KB
testcase_27 AC 278 ms
89,968 KB
testcase_28 AC 248 ms
89,956 KB
testcase_29 AC 249 ms
90,004 KB
testcase_30 AC 39 ms
53,624 KB
testcase_31 AC 103 ms
88,132 KB
testcase_32 AC 103 ms
88,132 KB
testcase_33 AC 110 ms
90,724 KB
testcase_34 AC 39 ms
53,624 KB
testcase_35 AC 39 ms
53,624 KB
testcase_36 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!
import heapq as hq

N,X,Y,Z=map(int,input().split())
A=list(map(lambda x:-int(x),input().split()))

hq.heapify(A)

for money,n in zip([10000,5000,1000],[Z,Y,X]):
    while n>0:
        shop=hq.heappop(A)
        use=min(-shop//money,n)
        if use==0:
            hq.heappush(A,shop)
            break
        else:
            shop+=use*money
            n-=use
            hq.heappush(A,shop)
        
    while A:
        if n==0:
            break
        else:
            garbage=hq.heappop(A)
            n-=1

if A:
    print("No")
else:
    print("Yes")
    

0