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"
#define INF 2147483647
using namespace std;
int find_best(int n)
{
int l = -1, r = n;
vector<int> res = {INF, INF};
while (1)
{
int tmp = (l + r) / 2;
res = ask(tmp);
if (res[0] > res[1])
r = tmp;
else if (res[1] > res[0])
l = tmp;
else
return (l + r) / 2;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |