結果
| 問題 | No.3281 Pacific White-sided Dolphin vs Monster |
| コンテスト | |
| ユーザー |
detteiuu
|
| 提出日時 | 2025-09-26 22:55:00 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 146 ms / 2,000 ms |
| + 371µs | |
| コード長 | 396 bytes |
| 記録 | |
| コンパイル時間 | 227 ms |
| コンパイル使用メモリ | 96,104 KB |
| 実行使用メモリ | 104,064 KB |
| 最終ジャッジ日時 | 2026-07-15 08:38:10 |
| 合計ジャッジ時間 | 7,267 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 51 |
ソースコード
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)
detteiuu