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"
#include <bits/stdc++.h>
using namespace std;
int find_best(int n)
{
for (int i = 0; i < n; ++i)
{
int j = i;
vector<int> v = ask(i);
if (v[0] == 0 && v[1] == 0)
return i;
int lo = i, hi = n - 1;
while (lo <= hi)
{
int mid = (lo + hi) >> 1;
vector<int> q = ask(mid);
if (q == v)
j = mid,
lo = mid + 1;
else
hi = mid - 1;
}
i = j;
}
assert(0);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |