結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,508 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 20 ms
8,348 KB
testcase_04 AC 20 ms
8,428 KB
testcase_05 AC 19 ms
8,344 KB
testcase_06 AC 20 ms
8,348 KB
testcase_07 WA -
testcase_08 AC 19 ms
8,392 KB
testcase_09 WA -
testcase_10 AC 175 ms
19,408 KB
testcase_11 AC 179 ms
18,952 KB
testcase_12 AC 169 ms
19,188 KB
testcase_13 AC 173 ms
18,848 KB
testcase_14 AC 184 ms
19,144 KB
testcase_15 AC 169 ms
18,700 KB
testcase_16 AC 175 ms
19,464 KB
testcase_17 AC 176 ms
19,056 KB
testcase_18 AC 174 ms
19,416 KB
testcase_19 AC 180 ms
18,764 KB
testcase_20 AC 163 ms
19,568 KB
testcase_21 AC 165 ms
18,828 KB
testcase_22 AC 165 ms
18,936 KB
testcase_23 AC 158 ms
18,832 KB
testcase_24 AC 167 ms
19,084 KB
testcase_25 AC 167 ms
18,876 KB
testcase_26 AC 162 ms
18,960 KB
testcase_27 AC 162 ms
19,296 KB
testcase_28 AC 165 ms
18,812 KB
testcase_29 AC 167 ms
18,920 KB
testcase_30 WA -
testcase_31 AC 101 ms
10,300 KB
testcase_32 WA -
testcase_33 AC 91 ms
19,096 KB
testcase_34 AC 18 ms
8,388 KB
testcase_35 AC 20 ms
8,536 KB
testcase_36 AC 19 ms
8,352 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
    else:
        tmp.append(i)

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
    else:
        tmp.append(i)

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