結果

問題 No.1015 おつりは要らないです
ユーザー NoneNone
提出日時 2021-05-01 08:12:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 154 ms / 2,000 ms
コード長 560 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 86,984 KB
実行使用メモリ 102,424 KB
最終ジャッジ日時 2023-09-26 17:10:43
合計ジャッジ時間 6,714 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,208 KB
testcase_01 AC 74 ms
71,332 KB
testcase_02 AC 73 ms
71,060 KB
testcase_03 AC 74 ms
71,264 KB
testcase_04 AC 74 ms
71,136 KB
testcase_05 AC 74 ms
71,328 KB
testcase_06 AC 73 ms
70,920 KB
testcase_07 AC 73 ms
71,304 KB
testcase_08 AC 74 ms
71,400 KB
testcase_09 AC 76 ms
71,224 KB
testcase_10 AC 154 ms
98,488 KB
testcase_11 AC 152 ms
98,832 KB
testcase_12 AC 148 ms
97,892 KB
testcase_13 AC 149 ms
98,400 KB
testcase_14 AC 154 ms
98,736 KB
testcase_15 AC 151 ms
98,540 KB
testcase_16 AC 150 ms
98,844 KB
testcase_17 AC 153 ms
98,700 KB
testcase_18 AC 149 ms
98,428 KB
testcase_19 AC 148 ms
98,796 KB
testcase_20 AC 148 ms
98,516 KB
testcase_21 AC 152 ms
102,048 KB
testcase_22 AC 150 ms
102,232 KB
testcase_23 AC 149 ms
101,940 KB
testcase_24 AC 153 ms
102,424 KB
testcase_25 AC 149 ms
102,232 KB
testcase_26 AC 149 ms
101,768 KB
testcase_27 AC 149 ms
101,772 KB
testcase_28 AC 150 ms
101,744 KB
testcase_29 AC 152 ms
102,048 KB
testcase_30 AC 73 ms
71,356 KB
testcase_31 AC 110 ms
99,324 KB
testcase_32 AC 110 ms
99,176 KB
testcase_33 AC 128 ms
98,112 KB
testcase_34 AC 75 ms
71,352 KB
testcase_35 AC 75 ms
71,264 KB
testcase_36 AC 74 ms
71,388 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,X,Y,Z=map(int, input().split())
A=list(map(int, input().split()))
A.sort(reverse=True)
B=[]
for a in A:
    z=min(a//10000,Z)
    a-=z*10000
    Z-=z
    if a>=0:
        B.append(a)
A=B
A.sort(reverse=True)
B=[]
for a in A:
    if Z>0:
        Z-=1
    else:
        y=min(a//5000,Y)
        a-=y*5000
        Y-=y
        if a>=0:
            B.append(a)
A=B
A.sort(reverse=True)
B=[]
for a in A:
    if Z>0:
        Z-=1
    elif Y>0:
        Y-=1
    else:
        x=a//1000+1
        X-=x



if X<0 or Y<0 or Z<0:
    print("No")
    exit()
print("Yes")
0