結果

問題 No.1015 おつりは要らないです
ユーザー AlphaGiraffeAlphaGiraffe
提出日時 2020-04-03 21:56:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 721 ms / 2,000 ms
コード長 635 bytes
コンパイル時間 203 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 21,920 KB
最終ジャッジ日時 2024-04-29 01:13:43
合計ジャッジ時間 15,571 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
10,752 KB
testcase_01 AC 33 ms
10,624 KB
testcase_02 AC 31 ms
10,624 KB
testcase_03 AC 34 ms
10,752 KB
testcase_04 AC 33 ms
10,752 KB
testcase_05 AC 33 ms
10,752 KB
testcase_06 AC 32 ms
10,624 KB
testcase_07 AC 31 ms
10,752 KB
testcase_08 AC 33 ms
10,752 KB
testcase_09 AC 33 ms
10,624 KB
testcase_10 AC 678 ms
21,496 KB
testcase_11 AC 721 ms
21,564 KB
testcase_12 AC 657 ms
21,016 KB
testcase_13 AC 701 ms
21,292 KB
testcase_14 AC 701 ms
21,920 KB
testcase_15 AC 642 ms
20,996 KB
testcase_16 AC 668 ms
21,136 KB
testcase_17 AC 680 ms
21,644 KB
testcase_18 AC 683 ms
21,160 KB
testcase_19 AC 659 ms
21,360 KB
testcase_20 AC 595 ms
21,088 KB
testcase_21 AC 568 ms
21,008 KB
testcase_22 AC 562 ms
21,140 KB
testcase_23 AC 538 ms
20,616 KB
testcase_24 AC 573 ms
21,152 KB
testcase_25 AC 554 ms
20,928 KB
testcase_26 AC 568 ms
21,116 KB
testcase_27 AC 568 ms
20,916 KB
testcase_28 AC 557 ms
20,868 KB
testcase_29 AC 570 ms
21,136 KB
testcase_30 AC 33 ms
10,880 KB
testcase_31 AC 244 ms
15,304 KB
testcase_32 AC 240 ms
15,300 KB
testcase_33 AC 120 ms
21,716 KB
testcase_34 AC 31 ms
10,752 KB
testcase_35 AC 32 ms
10,624 KB
testcase_36 AC 32 ms
10,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
from heapq import heappop, heappush,heapify

N,X,Y,Z=map(int,input().split())
A=list(map(int,input().split()))

H=[]

for i in range(N):
    heappush(H,-A[i])

flg=True

while H[0]<=0:
    M=heappop(H)
    if Z>0:
        num=max(1,min(Z,(-M)//10000))
        M+=10000*num
        Z-=num
        heappush(H,M)
    elif Y>0:
        num=max(1,min(Y,(-M)//5000))
        M+=5000*num
        Y-=num
        heappush(H,M)
    elif X>0:
        num=max(1,min(X,(-M)//1000))
        M+=1000*num
        X-=num
        heappush(H,M)
    elif M<=0:
        flg=False
        break
if flg:
    print("Yes")
else:
    print("No")
0