結果
| 問題 |
No.3281 Pacific White-sided Dolphin vs Monster
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-09-13 22:27:20 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 755 ms / 2,000 ms |
| コード長 | 436 bytes |
| コンパイル時間 | 169 ms |
| コンパイル使用メモリ | 82,276 KB |
| 実行使用メモリ | 101,080 KB |
| 最終ジャッジ日時 | 2025-10-03 17:35:01 |
| 合計ジャッジ時間 | 13,746 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 51 |
ソースコード
from heapq import *
N=int(input())
H=list(map(int,input().split()))
H=[-x for x in H]
heapify(H)
ok=N+100
ng=0
while ok-ng>1:
mid=(ok+ng)//2
hp=H[:]
for i in reversed(range(mid)):
if i>60:
heappop(hp)
else:
h=heappop(hp)
if h+(1<<i)<0:
heappush(hp,h+(1<<i))
if not hp:
break
if hp:
ng=mid
else:
ok=mid
print(ok)