結果

問題 No.3281 Pacific White-sided Dolphin vs Monster
ユーザー detteiuu
提出日時 2025-09-26 22:53:16
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 395 bytes
コンパイル時間 181 ms
コンパイル使用メモリ 82,416 KB
実行使用メモリ 95,832 KB
最終ジャッジ日時 2025-09-26 22:53:27
合計ジャッジ時間 6,114 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 39 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import heappush, heappop

N = int(input())
H = sorted(list(map(int, input().split())))

MAX = max(H[i].bit_length()-i-1 for i in range(N))

que = []
for h in H:
    heappush(que, -h)

cnt = MAX+N-1
for _ in range(MAX+N):
    if not que:
        break
    n = -heappop(que)
    n -= 1<<min(cnt, 60)
    cnt -= 1
    if 1 <= n:
        heappush(que, n)

print(N+MAX+1 if que else N+MAX)
0