# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
512197 | 600Mihnea | Hotter Colder (IOI10_hottercolder) | C++17 | 652 ms | 24412 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"
#include <bits/stdc++.h>
using namespace std;
int ask(int x) {
return Guess(x);
}
int solve(int l, int r) {
assert(l <= r);
if (l == r) {
return l;
}
int x = ask(l);
int y = ask(r);
int len = r - l + 1, mid = (l + r) / 2;
if (y == 0) {
assert(len % 2 == 1);
return mid;
} else {
if (len % 2 == 1) {
if (y == +1) {
return solve(mid + 1, r);
} else {
return solve(l, mid - 1);
}
} else {
if (y == +1) {
return solve(mid + 1, r);
} else {
return solve(l, mid);
}
}
}
}
int HC(int n){
return solve(1, n);
}
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... |