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(){
cout.tie(0); cin.tie(0); ios_base::sync_with_stdio(0);
int N;
cin>>N;
int left=1, right=N;
while(left <= right){
int tmp=(right-left)/2+left;
int ans;
cout<<"?"<<" "<<tmp<<endl;
cin>>ans;
if(ans==-1){
right=tmp;
}
else if(ans==0){
cout<<"= "<<tmp;
break;
}
else{
left=tmp;
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |