結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
8,384 KB
testcase_01 AC 19 ms
8,496 KB
testcase_02 AC 19 ms
8,560 KB
testcase_03 AC 21 ms
8,424 KB
testcase_04 AC 19 ms
8,356 KB
testcase_05 AC 20 ms
8,432 KB
testcase_06 AC 20 ms
8,472 KB
testcase_07 AC 19 ms
8,500 KB
testcase_08 AC 19 ms
8,412 KB
testcase_09 AC 19 ms
8,420 KB
testcase_10 AC 211 ms
19,460 KB
testcase_11 AC 210 ms
18,968 KB
testcase_12 AC 204 ms
19,292 KB
testcase_13 AC 206 ms
18,832 KB
testcase_14 AC 214 ms
19,256 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 194 ms
19,564 KB
testcase_21 AC 194 ms
18,860 KB
testcase_22 AC 195 ms
18,860 KB
testcase_23 AC 190 ms
18,880 KB
testcase_24 AC 199 ms
18,936 KB
testcase_25 AC 196 ms
18,800 KB
testcase_26 AC 192 ms
18,884 KB
testcase_27 AC 193 ms
19,288 KB
testcase_28 AC 195 ms
18,692 KB
testcase_29 AC 198 ms
18,908 KB
testcase_30 AC 19 ms
8,516 KB
testcase_31 AC 121 ms
11,448 KB
testcase_32 AC 120 ms
11,296 KB
testcase_33 AC 102 ms
19,292 KB
testcase_34 AC 19 ms
8,492 KB
testcase_35 AC 19 ms
8,428 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)

tmpa = copy.deepcopy(a)
tmpz = sum(map(lambda x:x//10, tmpa)) - Z

if tmpz > 0:
    tmpz *= 2
    tmpz -= Y
    if tmpz > 0:
        tmpz *= 5
        tmpz -= X
        if tmpz > 0:
            print('No')
            exit()
        else:
            X = abs(tmpz)
    else:
        Y = abs(tmpz)
    tmpz = 0

a = sorted(list(map(lambda x: x % 10, a)))

if tmpz < 0:
    a = a[:len(a) + tmpz]


tmpa = copy.deepcopy(a)
tmpy = sum(map(lambda x: x//5, tmpa)) - Y

if tmpy > 0:
    tmpy *= 5
    tmpy -= X
    if tmpy > 0:
        print('No')
        exit()
    else:
        X = abs(tmpy)
    tmpy = 0

a = sorted(list(map(lambda x: x % 5, a)))

if tmpy < 0:
    a = a[:len(a) + tmpy]
    

tmpx = sum(a) - X
print('Yes' if tmpx <= 0 else 'No')    
0