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 "prize.h"
using namespace std;
int find_best(int n)
{
int lo = 0, hi = n - 1;
while (true)
{
int mid = (hi + lo) / 2;
vector<int> res = ask(mid);
if (res[0] == res[1])
{
return mid;
}
else if (res[0] > res[1])
{
hi = mid - 1;
}
else
{
lo = mid + 1;
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |