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, x;
cin>>n;
int l=1, r=n;
while (1)
{
int md=(l+r)/2;
cout<<'?'<<' '<<md<<endl;
cin>>x;
if (x==0) return cout<<"= "<<md<<endl, 0;
if (x==-1) l=md+1;
else r=md-1;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |