結果

問題 No.1015 おつりは要らないです
ユーザー OKCH3COOHOKCH3COOH
提出日時 2020-04-11 08:21:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 527 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 11,884 KB
実行使用メモリ 10,172 KB
最終ジャッジ日時 2023-10-17 17:25:17
合計ジャッジ時間 7,243 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,172 KB
testcase_01 AC 33 ms
10,172 KB
testcase_02 AC 29 ms
10,172 KB
testcase_03 AC 30 ms
10,172 KB
testcase_04 AC 32 ms
10,172 KB
testcase_05 AC 30 ms
10,172 KB
testcase_06 AC 30 ms
10,172 KB
testcase_07 AC 29 ms
10,172 KB
testcase_08 AC 30 ms
10,172 KB
testcase_09 AC 30 ms
10,172 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 #

from heapq import heappush, heappop, heapify

N, sen, gosen, man = map(int, input().split())
A = list(map(lambda a: -int(a), input().split()))

heapify(A)
while A and man > 0:
    a = -heappop(A)
    a -= 10000
    man -= 1
    if a >= 0:
        heappush(A, -a)

while A and gosen > 0:
    a = -heappop(A)
    a -= 5000
    gosen -= 1
    if a >= 0:
        heappush(A, -a)

A = [-a for a in A]

cnt = 0
for a in A:
    c = -(-a // 1000)
    if c * 1000 == a:
        c += 1
    cnt += c

print('Yes' if cnt <= sen else 'No')
0