# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
41037 | 969 | Hotter Colder (IOI10_hottercolder) | C++14 | 861 ms | 55232 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 "grader.h"
#define HOTTER 1
#define COLDER -1
#define SAME 0
int HC(int N) {
int lo = 1, hi = N;
int g = Guess(lo);
int h = Guess(hi);
int mid = (lo + hi) / 2;
int ans = (1 + N) / 2;
int before = hi;
while (1) {
if (lo > hi) {
ans = hi;
break;
}
if (h == SAME) {
break;
}
g = h;
if (h == HOTTER) {
lo = mid + 1;
}
else if (h == COLDER) {
hi = mid - 1;
}
Guess(lo);
h = Guess(hi);
mid = (lo + hi) / 2;
ans = mid;
}
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |