結果
| 問題 | No.3281 Pacific White-sided Dolphin vs Monster |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-05-27 13:49:32 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
WJ
不安定
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 435 bytes |
| 記録 | |
| 最終ジャッジ日時 | 2026-07-15 08:33:38 |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
ソースコード
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)