样例都没过
by IAKIOI66666 @ 2024-05-16 06:47:29
```cpp
#include<bits/stdc++.h>
using namespace std;
const int maxn=(1<<7)+1;
int a[maxn],n;
int w(int l,int r)
{
if (l==r)return l;
int mid=(l+r)/2;
int ll=w(l,mid),rr=w(mid+1,r);
if (l!=1||r!=(1<<n)){
if (a[ll]>a[rr])return ll;
else return rr;
}
if (a[ll]<a[rr])return ll;
else return rr;
}
int main(){
cin>>n;
for(int i=1;i<=(1<<n);i++)cin>>a[i];
cout<<w(1,(1<<n));
return 0;
}
```
~~终于做出来了~~
by adminh @ 2024-05-16 19:49:52
@[adminh](/user/1249836) :谢谢
by IAKIOI66666 @ 2024-05-16 22:08:35