# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
410407 | rainboy | Hotter Colder (IOI10_hottercolder) | C11 | 643 ms | 24392 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.
/* https://ioi2010.org/competitiontask/day1/hottercolder/index.html */
#include "grader.h"
#define K 30
int n, flip;
int guess(int x) {
return Guess(flip ? n + 1 - x : x);
}
int nn[K];
void init() {
int i;
nn[0] = 1, nn[1] = 3, nn[2] = 7;
for (i = 3; i < K; i++)
nn[i] = nn[i - 2] + (1 << i);
}
int search(int lower, int upper, int x) {
while (lower < upper) {
int g = guess(x = lower + upper - x);
if (g == 0)
return (lower + upper) / 2;
if ((lower + upper - x < x) == (g > 0))
lower = (lower + upper) / 2 + 1;
else
# | 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... |