結果
| 問題 | No.156 キャンディー・ボックス |
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-03-31 17:37:24 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 907 ms / 2,000 ms |
| コード長 | 291 bytes |
| 記録 | |
| コンパイル時間 | 228 ms |
| コンパイル使用メモリ | 96,112 KB |
| 実行使用メモリ | 84,960 KB |
| 最終ジャッジ日時 | 2026-07-08 04:45:56 |
| 合計ジャッジ時間 | 7,184 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 30 |
ソースコード
import heapq
n, m = map(int, input().split())
c = list(map(int, input().split()))
heapq.heapify(c)
emptied = 0
for _ in range(m):
current = heapq.heappop(c)
new_val = current - 1
if new_val > 0:
heapq.heappush(c, new_val)
else:
emptied += 1
print(emptied)
lam6er