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