結果

問題 No.1015 おつりは要らないです
ユーザー Lily0727KLily0727K
提出日時 2020-04-04 13:09:26
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 535 bytes
コンパイル時間 86 ms
コンパイル使用メモリ 10,704 KB
実行使用メモリ 18,904 KB
最終ジャッジ日時 2023-09-16 05:40:29
合計ジャッジ時間 10,656 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,808 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 16 ms
7,708 KB
testcase_04 AC 16 ms
7,864 KB
testcase_05 AC 16 ms
7,712 KB
testcase_06 AC 16 ms
7,768 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 16 ms
7,708 KB
testcase_10 AC 370 ms
18,592 KB
testcase_11 AC 367 ms
18,836 KB
testcase_12 AC 350 ms
18,032 KB
testcase_13 AC 364 ms
18,596 KB
testcase_14 AC 369 ms
18,896 KB
testcase_15 AC 352 ms
18,020 KB
testcase_16 AC 362 ms
18,584 KB
testcase_17 AC 369 ms
18,772 KB
testcase_18 AC 356 ms
18,540 KB
testcase_19 AC 356 ms
18,380 KB
testcase_20 AC 400 ms
18,572 KB
testcase_21 AC 387 ms
18,628 KB
testcase_22 AC 384 ms
18,468 KB
testcase_23 AC 368 ms
18,028 KB
testcase_24 AC 393 ms
18,596 KB
testcase_25 AC 398 ms
18,700 KB
testcase_26 AC 383 ms
18,488 KB
testcase_27 AC 387 ms
18,460 KB
testcase_28 AC 386 ms
18,364 KB
testcase_29 AC 388 ms
18,644 KB
testcase_30 AC 16 ms
7,748 KB
testcase_31 AC 294 ms
12,072 KB
testcase_32 WA -
testcase_33 AC 274 ms
18,904 KB
testcase_34 AC 16 ms
7,748 KB
testcase_35 AC 16 ms
7,924 KB
testcase_36 AC 16 ms
7,716 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, *bill_cnt = map(int, input().split())
bill_money = [1000, 5000, 10000]

arr = [a + 1 for a in map(int, input().split())]
arr.sort(reverse=True)

for i in reversed(range(3)):
    cnt = bill_cnt[i]
    money = bill_money[i]

    for j in range(n):
        use_cnt = min(arr[j] // money, cnt)
        cnt -= use_cnt
        arr[j] -= use_cnt * money
    arr.sort(reverse=True)
    for j in range(n):
        if cnt > 0:
            cnt -= 1
            arr[j] -= money
    arr.sort(reverse=True)

print("Yes" if arr[0] <= 0 else "No")
0