結果

問題 No.1015 おつりは要らないです
ユーザー komkompikomkompi
提出日時 2023-11-04 10:12:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 287 ms / 2,000 ms
コード長 612 bytes
コンパイル時間 315 ms
コンパイル使用メモリ 81,848 KB
実行使用メモリ 90,708 KB
最終ジャッジ日時 2023-11-04 10:12:43
合計ジャッジ時間 8,142 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
53,608 KB
testcase_01 AC 39 ms
53,608 KB
testcase_02 AC 40 ms
53,608 KB
testcase_03 AC 39 ms
53,608 KB
testcase_04 AC 39 ms
53,608 KB
testcase_05 AC 39 ms
53,608 KB
testcase_06 AC 39 ms
53,608 KB
testcase_07 AC 39 ms
53,608 KB
testcase_08 AC 48 ms
53,608 KB
testcase_09 AC 38 ms
53,608 KB
testcase_10 AC 258 ms
90,204 KB
testcase_11 AC 264 ms
90,276 KB
testcase_12 AC 252 ms
90,108 KB
testcase_13 AC 262 ms
90,216 KB
testcase_14 AC 281 ms
90,324 KB
testcase_15 AC 260 ms
90,132 KB
testcase_16 AC 263 ms
90,204 KB
testcase_17 AC 283 ms
90,276 KB
testcase_18 AC 287 ms
90,192 KB
testcase_19 AC 263 ms
90,180 KB
testcase_20 AC 250 ms
90,000 KB
testcase_21 AC 246 ms
89,976 KB
testcase_22 AC 248 ms
89,976 KB
testcase_23 AC 251 ms
89,904 KB
testcase_24 AC 252 ms
90,024 KB
testcase_25 AC 259 ms
89,976 KB
testcase_26 AC 252 ms
89,976 KB
testcase_27 AC 265 ms
89,952 KB
testcase_28 AC 252 ms
89,940 KB
testcase_29 AC 251 ms
89,988 KB
testcase_30 AC 38 ms
53,608 KB
testcase_31 AC 103 ms
88,116 KB
testcase_32 AC 104 ms
88,116 KB
testcase_33 AC 116 ms
90,708 KB
testcase_34 AC 38 ms
53,608 KB
testcase_35 AC 41 ms
53,608 KB
testcase_36 AC 39 ms
53,608 KB
権限があれば一括ダウンロードができます

ソースコード

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 and A:
        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