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>
#include "prize.h"
using namespace std;
int i,j,n,m,l,r,c,xl,xr;
vector<int> aa;
int find_best(int n)
{
l=0;
r=n-1;
while (l<r)
{
c=l+(r-l)/2;
aa=ask(c);
xl=aa[0];
xr=aa[1];
//cout << l << " " << c << " " << r << " " << xl << " " << xr << "\n";
if (xl+xr==0)
{
return c;
}
else
{
if (xl==1)
{
r=c-1;
}
else
{
l=c+1;
}
}
}
return l;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |