# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1143689 | sano | Hotter Colder (IOI10_hottercolder) | C++20 | 0 ms | 0 KiB |
#include "grader.h"
#include<iostream>
#include<vector>
using namespace std;
int HC(int n) {
int l = 1;
int r = n;
while (l < r) {
Guess(l);
int x = Guess(r);
int mid = (l + r) / 2;
if (x == 0) {
return mid;
}
if (x == -1) {
r = mid - ((l + r) % 2 == 1);
}
if (x == 1) {
l = mid + 1;
}
}
return;
}