結果

問題 No.156 キャンディー・ボックス
ユーザー c-yanc-yan
提出日時 2020-07-15 21:17:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 268 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 21,376 KB
最終ジャッジ日時 2024-05-02 02:17:39
合計ジャッジ時間 8,563 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
21,376 KB
testcase_01 AC 27 ms
10,624 KB
testcase_02 AC 25 ms
10,752 KB
testcase_03 AC 26 ms
10,752 KB
testcase_04 AC 25 ms
10,752 KB
testcase_05 AC 155 ms
10,752 KB
testcase_06 AC 313 ms
10,752 KB
testcase_07 AC 243 ms
10,752 KB
testcase_08 AC 201 ms
10,752 KB
testcase_09 AC 160 ms
10,752 KB
testcase_10 AC 244 ms
10,752 KB
testcase_11 AC 146 ms
10,752 KB
testcase_12 AC 294 ms
10,752 KB
testcase_13 AC 213 ms
10,752 KB
testcase_14 AC 143 ms
10,624 KB
testcase_15 AC 241 ms
10,752 KB
testcase_16 AC 153 ms
10,752 KB
testcase_17 AC 222 ms
10,752 KB
testcase_18 AC 89 ms
10,624 KB
testcase_19 AC 101 ms
10,752 KB
testcase_20 AC 32 ms
10,624 KB
testcase_21 AC 44 ms
10,752 KB
testcase_22 AC 88 ms
10,752 KB
testcase_23 AC 54 ms
10,752 KB
testcase_24 AC 26 ms
10,752 KB
testcase_25 AC 26 ms
10,752 KB
testcase_26 AC 25 ms
10,624 KB
testcase_27 AC 25 ms
10,752 KB
testcase_28 AC 25 ms
10,752 KB
testcase_29 AC 25 ms
10,624 KB
testcase_30 AC 736 ms
10,624 KB
testcase_31 AC 284 ms
10,752 KB
testcase_32 TLE -
testcase_33 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import heapify, heappop, heappush

N, M, *C = map(int, open(0).read().split())

heapify(C)
for _ in range(M):
    if len(C) == 0:
        print(N)
        break
    t = heappop(C)
    t -= 1
    if t != 0:
        heappush(C, t)
else:
    print(N - len(C))
0