# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
319562 | 2020-11-05T14:02:35 Z | ehdtjskaqhd | Hotter Colder (IOI10_hottercolder) | C++17 | 0 ms | 0 KB |
#include <bits/stdc++.h> #include "grader.h" using namespace std; int HC(int N) { int l = 1, r = N, res; while (r - l > 1) { if (lg == l) res = Guess(r); else if (lg == r) res = -Guess(l); else Guess(l), res = Guess(r); debug() << imie(l) << imie(r) << imie(res); int mid = (l + r) / 2, adj = (l + r) % 2; if (!res) return mid; else if (~res) l = mid + adj; else r = mid; } return res > 0 ? r : l; }