結果
問題 |
No.156 キャンディー・ボックス
|
ユーザー |
![]() |
提出日時 | 2020-07-15 21:21:38 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 308 bytes |
コンパイル時間 | 176 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 11,008 KB |
最終ジャッジ日時 | 2024-11-22 12:04:15 |
合計ジャッジ時間 | 2,688 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 RE * 2 |
other | AC * 9 RE * 21 |
ソースコード
from heapq import heapify, heappop, heappush N, M, *C = map(int, open(0).read().split()) heapify(C) while M != 0: if len(C) == 0: print(N) break t = heappop(C) u = min((C[0] - t) + 1, t, M) t -= u M -= u if t != 0: heappush(C, t) else: print(N - len(C))