結果

問題 No.1015 おつりは要らないです
ユーザー Lily0727KLily0727K
提出日時 2020-04-04 13:06:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 526 bytes
コンパイル時間 163 ms
コンパイル使用メモリ 10,888 KB
実行使用メモリ 12,284 KB
最終ジャッジ日時 2023-09-16 05:39:42
合計ジャッジ時間 4,786 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
12,284 KB
testcase_01 AC 16 ms
7,964 KB
testcase_02 AC 16 ms
7,860 KB
testcase_03 AC 15 ms
7,932 KB
testcase_04 AC 15 ms
7,720 KB
testcase_05 AC 16 ms
7,836 KB
testcase_06 AC 16 ms
7,832 KB
testcase_07 AC 15 ms
7,784 KB
testcase_08 AC 16 ms
7,960 KB
testcase_09 AC 16 ms
7,876 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
権限があれば一括ダウンロードができます

ソースコード

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):
        while arr[j] >= money and cnt > 0:
            cnt -= 1
            arr[j] -= 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