# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
101938 | 2019-03-21T07:03:55 Z | joylintp | The Big Prize (IOI17_prize) | C++17 | 0 ms | 0 KB |
#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; } }