結果

問題 No.1015 おつりは要らないです
ユーザー tamatotamato
提出日時 2020-04-03 21:33:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 650 bytes
コンパイル時間 602 ms
コンパイル使用メモリ 86,860 KB
実行使用メモリ 90,940 KB
最終ジャッジ日時 2023-09-16 00:26:45
合計ジャッジ時間 5,859 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,256 KB
testcase_01 AC 69 ms
71,316 KB
testcase_02 AC 71 ms
71,328 KB
testcase_03 AC 72 ms
71,312 KB
testcase_04 AC 68 ms
71,304 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 69 ms
71,068 KB
testcase_08 AC 71 ms
71,308 KB
testcase_09 AC 74 ms
71,252 KB
testcase_10 AC 109 ms
90,404 KB
testcase_11 AC 107 ms
90,616 KB
testcase_12 AC 107 ms
90,508 KB
testcase_13 AC 109 ms
90,292 KB
testcase_14 AC 108 ms
90,360 KB
testcase_15 AC 107 ms
90,236 KB
testcase_16 AC 110 ms
90,512 KB
testcase_17 AC 112 ms
90,644 KB
testcase_18 AC 108 ms
90,272 KB
testcase_19 AC 108 ms
90,456 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 71 ms
71,192 KB
testcase_31 AC 94 ms
89,004 KB
testcase_32 AC 96 ms
88,608 KB
testcase_33 AC 102 ms
90,940 KB
testcase_34 AC 69 ms
71,068 KB
testcase_35 AC 69 ms
71,240 KB
testcase_36 AC 68 ms
71,064 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    import sys
    input = sys.stdin.readline

    N, x, y, z = map(int, input().split())
    A = list(map(int, input().split()))
    for i, a in enumerate(A):
        A[i] = (a // 1000 + 1) * 1000

    for i, a in enumerate(A):
        d = min(z, a // 10000)
        A[i] -= d * 10000
        z -= d
    for i, a in enumerate(A):
        d = min(y, a // 5000)
        A[i] -= d * 5000
        y -= d
    A.sort()
    for i in range(min(y+z, N)):
        A[-i-1] = 0
    for i, a in enumerate(A):
        x -= a // 1000
        if x < 0:
            print('No')
            exit()
    print('Yes')


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