結果

問題 No.1015 おつりは要らないです
ユーザー AlphaGiraffeAlphaGiraffe
提出日時 2020-04-03 21:56:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 586 ms / 2,000 ms
コード長 635 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 10,792 KB
実行使用メモリ 19,052 KB
最終ジャッジ日時 2023-08-11 08:41:04
合計ジャッジ時間 12,950 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,224 KB
testcase_01 AC 16 ms
8,216 KB
testcase_02 AC 17 ms
8,172 KB
testcase_03 AC 16 ms
8,260 KB
testcase_04 AC 16 ms
8,200 KB
testcase_05 AC 16 ms
8,308 KB
testcase_06 AC 16 ms
8,172 KB
testcase_07 AC 16 ms
8,256 KB
testcase_08 AC 16 ms
8,224 KB
testcase_09 AC 17 ms
8,272 KB
testcase_10 AC 561 ms
18,692 KB
testcase_11 AC 564 ms
18,844 KB
testcase_12 AC 529 ms
18,248 KB
testcase_13 AC 554 ms
18,720 KB
testcase_14 AC 581 ms
18,924 KB
testcase_15 AC 537 ms
18,256 KB
testcase_16 AC 557 ms
18,588 KB
testcase_17 AC 586 ms
18,756 KB
testcase_18 AC 569 ms
18,524 KB
testcase_19 AC 548 ms
18,568 KB
testcase_20 AC 478 ms
18,692 KB
testcase_21 AC 465 ms
18,776 KB
testcase_22 AC 470 ms
18,772 KB
testcase_23 AC 457 ms
18,192 KB
testcase_24 AC 487 ms
18,720 KB
testcase_25 AC 484 ms
18,648 KB
testcase_26 AC 460 ms
18,612 KB
testcase_27 AC 469 ms
18,512 KB
testcase_28 AC 455 ms
18,580 KB
testcase_29 AC 472 ms
18,676 KB
testcase_30 AC 16 ms
8,260 KB
testcase_31 AC 197 ms
12,700 KB
testcase_32 AC 202 ms
12,908 KB
testcase_33 AC 92 ms
19,052 KB
testcase_34 AC 17 ms
8,308 KB
testcase_35 AC 17 ms
8,356 KB
testcase_36 AC 17 ms
8,352 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