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 <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin>>N;
int l=0,r=N+1;
while(r-l>1){
int m=l+(r-l)/2;
cout<<"? "<<m<<endl;
int h;
cin>>h;
if(h==0){
cout<<"= "<<m<<endl;
return 0;
}else if(h==1)r=m;
else l=m+1;
}
cout<<"= "<<l<<endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |