# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
39801 | 0xrgb | Hotter Colder (IOI10_hottercolder) | C++11 | 1060 ms | 8156 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.
// Author: Gordon V. Cormack; solves Subtask 4
#include <stdio.h>
#include <math.h>
#include <assert.h>
#include <stdlib.h>
#include "grader.h"
int t[50];
#define max(a, b) ((a)>(b)?(a):(b))
#define min(a, b) ((a)<(b)?(a):(b))
int fix(int end, int x) {
// returns value at x steps from end
if (end == 1) return x;
return end-x+1;
}
int midgame(int p, int a, int b) {
// returns Jill's number, assuming
// p = previous guess, [a .. b] = interval of remaining candidates
if (a == b) return a;
if (a > b) {
int t = a;
a = b;
b = t;
}
// a < b
int sz, mid=-999;
for (sz=3; b-a+1 > sz; sz = 2*sz+1);
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... |