結果

問題 No.1015 おつりは要らないです
ユーザー konchanksukonchanksu
提出日時 2020-04-03 23:52:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 835 bytes
コンパイル時間 122 ms
コンパイル使用メモリ 10,876 KB
実行使用メモリ 19,544 KB
最終ジャッジ日時 2023-09-16 05:05:56
合計ジャッジ時間 5,216 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,372 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 18 ms
8,532 KB
testcase_04 AC 19 ms
8,404 KB
testcase_05 AC 18 ms
8,376 KB
testcase_06 AC 19 ms
8,480 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 123 ms
19,432 KB
testcase_11 AC 125 ms
18,932 KB
testcase_12 AC 137 ms
19,192 KB
testcase_13 AC 124 ms
18,976 KB
testcase_14 AC 131 ms
19,272 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 160 ms
19,544 KB
testcase_21 AC 162 ms
18,960 KB
testcase_22 AC 159 ms
18,772 KB
testcase_23 AC 153 ms
18,896 KB
testcase_24 AC 163 ms
18,956 KB
testcase_25 AC 165 ms
18,856 KB
testcase_26 AC 158 ms
18,828 KB
testcase_27 AC 162 ms
19,376 KB
testcase_28 AC 160 ms
18,700 KB
testcase_29 AC 168 ms
18,940 KB
testcase_30 WA -
testcase_31 AC 101 ms
10,236 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 19 ms
8,432 KB
testcase_35 AC 19 ms
8,536 KB
testcase_36 AC 19 ms
8,500 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import copy

# 入力
N, X, Y, Z = map(int, input().split())
a = list(map(int, input().split()))
a = [i // 1000 + 1 for i in a]
a = sorted(a, reverse=True)

# 10000円
ans = True
tmp = []

for i in a:
    if Z > 0:
        if i // 10 > Z:
            tmp.append(i - 10 * Z)
            Z = 0         
        else:
            tmp.append(i % 10)
            Z -= i // 10

tmp.sort()
if Z > 0:
    tmp = tmp[:len(tmp) - Z]

a = tmp
tmp = []

for i in a:    
    if Y > 0:
        if i // 5 > Y:
            tmp.append(i - 5 * Y)
            Y = 0
        else:
            tmp.append(i % 5)
            Y -= i // 5

tmp.sort()
if Y > 0:
    tmp = tmp[:len(tmp) - Y]

a = tmp
tmp = []

for i in a:
    if X < 0:
        ans = False
        break
    
    if X > 0:
        X -= i

if X < 0:
    ans = False

print('Yes' if ans else 'No')
0