結果

問題 No.1015 おつりは要らないです
ユーザー Lily0727KLily0727K
提出日時 2020-04-04 13:12:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 454 ms / 2,000 ms
コード長 570 bytes
コンパイル時間 117 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 21,536 KB
最終ジャッジ日時 2024-04-29 05:06:26
合計ジャッジ時間 10,792 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,624 KB
testcase_01 AC 31 ms
10,752 KB
testcase_02 AC 30 ms
10,752 KB
testcase_03 AC 30 ms
10,624 KB
testcase_04 AC 31 ms
10,624 KB
testcase_05 AC 31 ms
10,752 KB
testcase_06 AC 31 ms
10,624 KB
testcase_07 AC 31 ms
10,624 KB
testcase_08 AC 30 ms
10,624 KB
testcase_09 AC 30 ms
10,496 KB
testcase_10 AC 436 ms
21,100 KB
testcase_11 AC 442 ms
21,268 KB
testcase_12 AC 417 ms
20,612 KB
testcase_13 AC 435 ms
21,116 KB
testcase_14 AC 445 ms
21,536 KB
testcase_15 AC 419 ms
20,792 KB
testcase_16 AC 429 ms
21,096 KB
testcase_17 AC 451 ms
21,412 KB
testcase_18 AC 428 ms
21,056 KB
testcase_19 AC 454 ms
20,908 KB
testcase_20 AC 364 ms
21,056 KB
testcase_21 AC 366 ms
20,968 KB
testcase_22 AC 370 ms
20,836 KB
testcase_23 AC 361 ms
20,628 KB
testcase_24 AC 387 ms
21,108 KB
testcase_25 AC 370 ms
20,844 KB
testcase_26 AC 361 ms
20,820 KB
testcase_27 AC 363 ms
20,752 KB
testcase_28 AC 361 ms
20,604 KB
testcase_29 AC 361 ms
21,000 KB
testcase_30 AC 30 ms
10,752 KB
testcase_31 AC 271 ms
14,864 KB
testcase_32 AC 273 ms
14,736 KB
testcase_33 AC 344 ms
21,416 KB
testcase_34 AC 30 ms
10,752 KB
testcase_35 AC 30 ms
10,624 KB
testcase_36 AC 30 ms
10,624 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):
        if arr[j] > 0:
            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