# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
356457 | 2021-01-23T11:46:33 Z | Mefarnis | Hotter Colder (IOI10_hottercolder) | C++14 | 0 ms | 0 KB |
#include <bits/stdc++.h> #include "grader.h" using namespace std; void HC(int n) { int l = 1 , r = n , last = 1; Guess(last); while(l < r) { int mid = (l+r) >> 1; int x = (last == l) ? r : l; int val = Guess(x); if(val == 0) return mid; int y = (val == 1) ? x : last; if((l+r)%2 == 0) { if(y == l) r = mid-1; else l = mid+1; } else { if(y == l) r = mid; else l = mid+1; } last = x; } return l; }