結果

問題 No.1015 おつりは要らないです
ユーザー NoneNone
提出日時 2021-05-01 07:53:47
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 492 bytes
コンパイル時間 358 ms
コンパイル使用メモリ 87,084 KB
実行使用メモリ 92,344 KB
最終ジャッジ日時 2023-09-26 16:44:03
合計ジャッジ時間 5,983 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
70,984 KB
testcase_01 AC 70 ms
71,164 KB
testcase_02 AC 72 ms
71,208 KB
testcase_03 AC 74 ms
71,104 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 72 ms
71,312 KB
testcase_08 AC 73 ms
71,468 KB
testcase_09 AC 72 ms
71,356 KB
testcase_10 AC 124 ms
91,908 KB
testcase_11 AC 120 ms
92,248 KB
testcase_12 AC 120 ms
91,888 KB
testcase_13 AC 123 ms
91,912 KB
testcase_14 AC 125 ms
92,344 KB
testcase_15 AC 123 ms
92,188 KB
testcase_16 AC 124 ms
92,136 KB
testcase_17 AC 124 ms
92,292 KB
testcase_18 AC 124 ms
91,940 KB
testcase_19 AC 124 ms
92,136 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 70 ms
71,432 KB
testcase_31 AC 95 ms
88,908 KB
testcase_32 AC 95 ms
88,912 KB
testcase_33 AC 104 ms
91,640 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 72 ms
71,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,X,Y,Z=map(int, input().split())
A=list(map(int, input().split()))
A.sort(reverse=True)
for a in A:
    if X<0 or Y<0 or Z<0:
        print("No")
        exit()
    z=min(a//10000,Z)
    a-=z*10000
    Z-=z
    if a<0:
        continue
    if Y==X==0:
        Z-=1
        continue
    y=min(a//5000,Y)
    a-=y*5000
    Y-=y
    if a<0:
        continue
    if X==0:
        Y-=1
        continue
    x=(a-1)//1000 + 1
    X-=x

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