結果

問題 No.3281 Pacific White-sided Dolphin vs Monster
コンテスト
ユーザー hirayuu_yc
提出日時 2025-05-27 13:49:32
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WJ  
(最新)
AC  
(最初)
実行時間 -
コード長 435 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
最終ジャッジ日時 2026-07-15 08:33:38
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)

ソースコード

diff #
raw source code

N=int(input())
H=list(map(int,input().split()))
H.sort()
ng=0
ok=N+100
while ok-ng>1:
    mid=(ok+ng)//2
    now=mid
    h=H[:]
    while h and now>61:
        now-=1
        h.pop()
    if not h:
        ok=mid
        continue
    for i in range(now-1,-1,-1):
        mx=(-1,-1)
        for j in range(len(h)):
            mx=max(mx,(h[j],j))
        h[mx[1]]-=1<<i
    if max(h)<=0:
        ok=mid
    else:
        ng=mid
print(ok)
0