結果
| 問題 | No.3281 Pacific White-sided Dolphin vs Monster |
| コンテスト | |
| ユーザー |
timi
|
| 提出日時 | 2025-09-26 21:39:38 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 583 ms / 2,000 ms |
| + 512µs | |
| コード長 | 503 bytes |
| 記録 | |
| コンパイル時間 | 241 ms |
| コンパイル使用メモリ | 96,232 KB |
| 実行使用メモリ | 152,760 KB |
| 最終ジャッジ日時 | 2026-07-15 08:36:08 |
| 合計ジャッジ時間 | 13,479 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 51 |
ソースコード
#N,X,Q=map(int, input().split())
N=int(input())
H=list(map(int, input().split()))
H=sorted(H)
ng,ok=0,100+N+1
import heapq
while ok-ng>1:
mid=(ok+ng)//2
C=[1]
for i in range(mid-1):
C.append(C[-1]*2)
if C[-1]>10**18:
C[-1]=10**18
E=[]
for h in H:
heapq.heappush(E,-h)
for c in C[::-1]:
d=heapq.heappop(E)
d*=-1
e=d-c
if e>0:
heapq.heappush(E,-e)
if len(E)==0:
break
if len(E)==0:
ok=mid
else:
ng=mid
print(ok)
timi