# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
26655 | grands | Hotter Colder (IOI10_hottercolder) | C++14 | 790 ms | 8184 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"
int HC(int N){
int prev = 1;
int now = N;
int h = Guess(prev);
int g;
while (1){
g = Guess(now);
//printf("%d %d\n", prev, now);
if (g == 0) {
//printf("%d\n", (prev + now) / 2);
return (prev+now) / 2;
}
if (g < 0) {
if (prev + 1 == now){
//printf("hot ");
return prev;
}
else if (now + 1 == prev){
//printf("hot2 ");
return prev;
}
h = Guess(prev);
now = ((prev + now) / 2);
}
if (g > 0){
if (prev + 1 == now){
//printf("cold1 ");
return now;
}
else if(now+1==prev){
//printf("cold2 ");
return now;
}
int temp = ((prev + now) / 2 );
prev = now;
now = temp;
h = g;
}
}
}
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... |