#include "grader.h"
#include <bits/stdc++.h>
using namespace std;
const int HOTTER = 1, COLDER = -1, SAME = 0;
template <class Func>
int FIND_SMALLEST(int l, int r, Func f) {
int res = r + 1;
while (l <= r) {
int m = (l + r) >> 1;
if (f(m)) res = m, r = m - 1;
else l = m + 1;
}
return res;
}
template <class Func>
int FIND_LARGEST(int l, int r, Func f) {
int res = l - 1;
while (l <= r) {
int m = (l + r) >> 1;
if (f(m)) res = m, l = m + 1;
else r = m - 1;
}
return res;
}
int findGiven(int l, int r) {
if (l == r)
return r;
int id = Guess(r);
int m = (l + r) >> 1;
if (id == SAME)
return m;
if (id == HOTTER)
return findGiven(r, m);
Guess(l);
return findGiven(l, m);
}
int HC(int N) {
Guess(1);
return findGiven(1, N);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
10007 ms |
1236 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
10042 ms |
1236 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
10058 ms |
1236 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
10017 ms |
8016 KB |
Time limit exceeded |