This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "prize.h"
#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,e,i,j,ii,jj,zx,xc,fx[200009],sq=450,lef,rig,mid;
int F[200009];
pair <int, int> P[200009];
/*vector <int> ask(int q){
int QA=0,WA=0,QQ=0;
for(QQ=0; QQ<q; QQ++){
if(F[QQ]<F[q]) QA++;
}
for(QQ=q+1; QQ<a; QQ++){
if(F[QQ]<F[q]) WA++;
}
vector <int> QQA;
QQA.push_back(QA);QQA.push_back(WA);
return QQA;
}*/
pair <int, int> Ask(int q){
vector <int> QA=ask(q);
return make_pair(QA[0],QA[1]);
}
int find_best(int Nn) {
a=Nn;
lef=-1;rig=a;
while(1){
if(lef+1>=rig) break;
mid=(lef+rig)/2;
P[mid]=Ask(mid);
if(P[mid].first+P[mid].second==0){
return mid;
}
if(P[mid].first!=0){
rig=mid;
}else{
lef=mid;
}
}
return 0;
}
/*int main(){
ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
cin>>a;
for(i=0; i<a; i++){
cin>>F[i];
}
cout<<find_best(a);
return 0;
}*/
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |