# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
119617 | win11905 | Hotter Colder (IOI10_hottercolder) | C++11 | 820 ms | 8188 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 <bits/stdc++.h>
#include "grader.h"
using namespace std;
int solve(int l, int r) {
int sz = r-l+1;
if(sz == 1) return l;
if(sz == 2) {
Guess(l);
if(Guess(r) == 1) return r;
else return l;
}
if(sz == 3) {
Guess(l);
int val = Guess(r);
if(val == 1) return r;
if(val == 0) return r-1;
return l;
}
int a = l + sz/4;
int b = l + 3*sz/4;
Guess(a);
int val = Guess(b);
int m = a + b >> 1;
if(val == 0) return m;
if(val == 1) return solve(m+1, r);
return solve(l, m);
}
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... |