結果

問題 No.1015 おつりは要らないです
ユーザー w0mbatw0mbat
提出日時 2020-04-03 22:59:28
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 755 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 87,312 KB
実行使用メモリ 94,460 KB
最終ジャッジ日時 2023-09-16 04:12:00
合計ジャッジ時間 5,845 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,360 KB
testcase_01 AC 68 ms
71,332 KB
testcase_02 AC 71 ms
71,296 KB
testcase_03 AC 67 ms
71,360 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 69 ms
71,412 KB
testcase_07 AC 68 ms
70,836 KB
testcase_08 AC 69 ms
71,308 KB
testcase_09 AC 67 ms
71,228 KB
testcase_10 AC 118 ms
93,544 KB
testcase_11 AC 117 ms
93,656 KB
testcase_12 AC 110 ms
93,776 KB
testcase_13 AC 113 ms
93,784 KB
testcase_14 AC 113 ms
93,892 KB
testcase_15 AC 116 ms
93,688 KB
testcase_16 AC 114 ms
93,752 KB
testcase_17 AC 121 ms
93,972 KB
testcase_18 AC 114 ms
93,676 KB
testcase_19 AC 114 ms
93,132 KB
testcase_20 AC 111 ms
93,248 KB
testcase_21 AC 111 ms
93,524 KB
testcase_22 AC 113 ms
93,524 KB
testcase_23 AC 113 ms
93,412 KB
testcase_24 AC 116 ms
93,544 KB
testcase_25 AC 117 ms
93,548 KB
testcase_26 AC 111 ms
93,332 KB
testcase_27 AC 111 ms
93,244 KB
testcase_28 AC 112 ms
93,372 KB
testcase_29 AC 113 ms
93,480 KB
testcase_30 AC 70 ms
71,332 KB
testcase_31 AC 106 ms
91,324 KB
testcase_32 AC 104 ms
91,288 KB
testcase_33 AC 110 ms
94,460 KB
testcase_34 WA -
testcase_35 AC 69 ms
70,948 KB
testcase_36 AC 69 ms
71,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ans = True
for a in A:
    d = a // 10000
    d = min(Z,d)
    Z -= d
    m = a - d * 10000

    d = m // 5000
    d = min(Y,d)
    Y -= d
    m -= d * 5000

    if m > 5000 and Z > 0:
        m -= 10000
        Z -= 1
    if m > 4000 and Y > 0:
        m -= 5000
        Y -= 1

    if m >= 0:
        d = m//1000 + 1
        if d <= X:
            X -= d
            m -= d * 1000

    if m >= 0 and Y > 0:
        d = m//5000 + 1
        if d <= Y:
            Y -= d
            m -= d * 5000
    if m >= 0 and Z > 0:
        d = m//10000 + 1
        if d <= Z:
            Z -= d
            m -= d * 10000
    if m >= 0:
        ans = False
        break
print('Yes' if ans else 'No')
0