結果

問題 No.1015 おつりは要らないです
ユーザー もりをもりを
提出日時 2020-04-03 21:38:36
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,057 bytes
コンパイル時間 407 ms
コンパイル使用メモリ 87,172 KB
実行使用メモリ 98,676 KB
最終ジャッジ日時 2023-09-16 00:33:23
合計ジャッジ時間 5,667 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,356 KB
testcase_01 AC 68 ms
71,404 KB
testcase_02 AC 67 ms
71,404 KB
testcase_03 AC 67 ms
71,308 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 68 ms
71,240 KB
testcase_07 AC 67 ms
71,352 KB
testcase_08 AC 68 ms
71,408 KB
testcase_09 AC 67 ms
71,340 KB
testcase_10 AC 111 ms
97,892 KB
testcase_11 AC 111 ms
97,784 KB
testcase_12 AC 112 ms
97,912 KB
testcase_13 AC 110 ms
98,132 KB
testcase_14 AC 112 ms
97,828 KB
testcase_15 AC 110 ms
97,928 KB
testcase_16 AC 111 ms
98,176 KB
testcase_17 AC 114 ms
97,892 KB
testcase_18 AC 111 ms
98,164 KB
testcase_19 AC 110 ms
98,036 KB
testcase_20 AC 115 ms
97,452 KB
testcase_21 AC 115 ms
97,904 KB
testcase_22 AC 116 ms
97,612 KB
testcase_23 AC 116 ms
97,436 KB
testcase_24 AC 117 ms
98,000 KB
testcase_25 AC 119 ms
97,860 KB
testcase_26 AC 119 ms
97,720 KB
testcase_27 AC 116 ms
97,796 KB
testcase_28 AC 117 ms
97,432 KB
testcase_29 AC 119 ms
97,776 KB
testcase_30 AC 69 ms
71,432 KB
testcase_31 AC 104 ms
95,396 KB
testcase_32 AC 105 ms
95,612 KB
testcase_33 AC 110 ms
98,676 KB
testcase_34 WA -
testcase_35 AC 68 ms
71,424 KB
testcase_36 AC 70 ms
71,388 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,x,y,z = map(int,input().split())
a = list(map(lambda x:int(x)+1,input().split()))
b = []
for i in a:
    p,q = divmod(i, 1000)
    if q:
        p += 1
    b.append(p)

for i in b:
    yukichi = min(i // 10, z)
    z -= yukichi
    i -= yukichi * 10
    higuchi = min(i // 5, y)
    y -= higuchi
    i -= higuchi * 5
    if i > x:
        md = i % 10
        if md >= 5:
            if y > 0 and x >= md - 5:
                y -= 1
                x -= md - 5
            elif z > 0:
                z -= 1
            elif y > 1:
                y -= 2
            else:
                print('No')
                exit(0)
        else:
            if x >= md:
                x -= md
            elif y > 0:
                y -= 1
            elif z > 0:
                z -= 1
            else:
                print('No')
                exit(0)
        mm = i // 10
        ok = min(mm, z)
        z -= ok
        mm -= ok
        if 2 * mm > y:
            print('No')
            exit(0)
        y -= mm // 2
    else:
        x -= i

print('Yes')
0