# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
41048 | pica4500 | Hotter Colder (IOI10_hottercolder) | C++98 | 10091 ms | 20216 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 <iostream>
using namespace std;
pair<int, int> cache[501][501];
pair<int, int> get(int lo, int hi) {
pair<int, int>& ret = cache[lo][hi];
if (ret.first != -2) return ret;
ret.first = Guess(lo);
ret.second = Guess(hi);
return ret;
}
int HC(int N){
for (int i = 1; i <= N; i++) {
for (int j = 1; j <= N; j++) {
cache[i][j].first = -2;
cache[i][j].second = -2;
}
}
int lo = 1;
int hi = N;
bool flag = 0;
while (lo < hi) {
pair<int, int> loHi = get(lo, hi);
int mid = (lo + hi) / 2;
if (loHi.second == 0) return mid;
else if (loHi.second == 1) lo = mid + 1;
else hi = mid;
}
return lo;
}
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... |