結果

問題 No.1015 おつりは要らないです
ユーザー w0mbatw0mbat
提出日時 2021-05-18 18:01:48
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 726 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 82,160 KB
実行使用メモリ 92,316 KB
最終ジャッジ日時 2024-04-17 06:50:43
合計ジャッジ時間 4,876 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,228 KB
testcase_01 AC 36 ms
52,692 KB
testcase_02 AC 37 ms
52,276 KB
testcase_03 AC 41 ms
52,828 KB
testcase_04 AC 37 ms
52,308 KB
testcase_05 AC 37 ms
52,220 KB
testcase_06 AC 38 ms
52,368 KB
testcase_07 AC 37 ms
53,216 KB
testcase_08 AC 37 ms
52,572 KB
testcase_09 AC 38 ms
53,772 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 99 ms
91,092 KB
testcase_16 AC 102 ms
91,832 KB
testcase_17 AC 105 ms
91,820 KB
testcase_18 AC 106 ms
91,560 KB
testcase_19 AC 104 ms
91,896 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 39 ms
52,604 KB
testcase_31 AC 78 ms
88,352 KB
testcase_32 AC 79 ms
88,464 KB
testcase_33 AC 86 ms
91,748 KB
testcase_34 AC 40 ms
53,248 KB
testcase_35 WA -
testcase_36 AC 41 ms
52,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
def main():
    input = sys.stdin.readline
    N, X, *YZ = map(int, input().split())
    C = (5000, 10000)
    *A, = map(int, input().split())
    for i in range(N): A[i] += 1

    for i in range(1, -1, -1):
        for j in range(N):
            z = min(YZ[i], (A[j] - 1) // C[i])
            A[j] -= z * C[i]
            YZ[i] -= z
        A.sort(reverse=True)
        for j in range(N):
            if YZ[i] == 0: break
            if A[j] == 0: break
            A[j] = 0
            YZ[i] -= 1

    for i in range(N):
        if A[i] == 0: continue
        x = A[i] // 1000 + 1
        if x > X:
            print('No')
            exit()
        X -= x
    print('Yes')

if __name__ == '__main__':
    main()
0