結果

問題 No.1015 おつりは要らないです
ユーザー lloyzlloyz
提出日時 2022-06-29 22:47:52
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 673 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 91,392 KB
最終ジャッジ日時 2024-05-02 19:25:44
合計ジャッジ時間 5,574 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
51,456 KB
testcase_01 AC 44 ms
51,712 KB
testcase_02 AC 44 ms
52,224 KB
testcase_03 AC 42 ms
51,840 KB
testcase_04 WA -
testcase_05 AC 47 ms
51,456 KB
testcase_06 AC 43 ms
51,968 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 42 ms
51,584 KB
testcase_10 AC 109 ms
90,624 KB
testcase_11 AC 103 ms
89,472 KB
testcase_12 AC 108 ms
90,752 KB
testcase_13 AC 113 ms
90,496 KB
testcase_14 AC 114 ms
91,392 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 109 ms
90,368 KB
testcase_21 AC 104 ms
90,368 KB
testcase_22 AC 109 ms
90,240 KB
testcase_23 AC 107 ms
90,112 KB
testcase_24 AC 109 ms
90,880 KB
testcase_25 AC 108 ms
90,624 KB
testcase_26 AC 107 ms
90,368 KB
testcase_27 AC 108 ms
90,112 KB
testcase_28 AC 106 ms
90,496 KB
testcase_29 AC 113 ms
91,136 KB
testcase_30 AC 43 ms
52,224 KB
testcase_31 AC 85 ms
84,608 KB
testcase_32 AC 83 ms
85,120 KB
testcase_33 WA -
testcase_34 AC 45 ms
51,840 KB
testcase_35 AC 41 ms
52,224 KB
testcase_36 AC 42 ms
51,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, x, y, z = map(int, input().split())
A = list(map(int, input().split()))

A.sort()
for i in range(n):
    flag = False
    for j in [1000, 5000, 10000]:
        a = A[i] // j + 1
        if j == 1000:
            if x >= a:
                flag = True
                x -= a
                break
            A[i] -= x * j
        elif j == 5000:
            if y >= a:
                flag = True
                y -= a
                break
            A[i] -= y * j
        else:
            if z >= a:
                flag = True
                z -= a
                break
            A[i] -= z * j
    if not flag:
        print("No")
        exit()
print("Yes")

0