結果

問題 No.1015 おつりは要らないです
ユーザー ptotqptotq
提出日時 2020-04-03 21:47:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 757 bytes
コンパイル時間 437 ms
コンパイル使用メモリ 10,716 KB
実行使用メモリ 19,076 KB
最終ジャッジ日時 2023-09-16 00:57:27
合計ジャッジ時間 6,532 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,720 KB
testcase_01 AC 16 ms
8,212 KB
testcase_02 AC 17 ms
8,132 KB
testcase_03 AC 16 ms
7,772 KB
testcase_04 AC 16 ms
7,936 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 16 ms
8,272 KB
testcase_08 AC 16 ms
8,144 KB
testcase_09 AC 16 ms
8,236 KB
testcase_10 AC 232 ms
18,752 KB
testcase_11 AC 231 ms
18,840 KB
testcase_12 AC 223 ms
18,268 KB
testcase_13 AC 237 ms
18,400 KB
testcase_14 AC 243 ms
19,040 KB
testcase_15 AC 219 ms
18,324 KB
testcase_16 AC 225 ms
18,748 KB
testcase_17 AC 239 ms
18,912 KB
testcase_18 AC 228 ms
18,368 KB
testcase_19 AC 226 ms
18,684 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 17 ms
8,144 KB
testcase_31 AC 86 ms
9,936 KB
testcase_32 AC 83 ms
10,096 KB
testcase_33 AC 66 ms
19,076 KB
testcase_34 AC 17 ms
7,792 KB
testcase_35 WA -
testcase_36 AC 16 ms
7,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N, X, Y, Z = map(int, input().split())
a = list(map(int, input().split()))

for i in range(N):
    if a[i] >= 10000:
        n = min(Z, a[i]//10000)
        a[i] -= n * 10000
        Z -= n
    if a[i] >= 5000:
        n = min(Y, a[i]//5000)
        a[i] -= n * 5000
        Y -= n
    if a[i] >= 5000:
        req = a[i] // 1000 + 1
        if req > X:
            print('No')
            exit()
        a[i] -= req * 1000
        X -= req

a.sort(reverse=True)

for i in range(N):
    if a[i] < 0:
        break
    if Z:
        Z -= 1
        continue
    if Y:
        Y -= 1
        continue
    req = a[i] // 1000 + 1
    if X >= req:
        X -= req
        continue

    print('No')
    exit()

print('Yes')
0