# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
101938 | joylintp | The Big Prize (IOI17_prize) | C++17 | 0 ms | 0 KiB |
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>
#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;
}
}