#include "cycle.h"
void escape(int n) {
bool works = jump(0);
while (!works) jump(n/2);
int lo = 0;
int hi = n/2;
int cur_dist = 0;
while (lo < hi) {
int m = (lo + hi + 1)/2;
if (jump((m - cur_dist + n) % n)) {
lo = m;
} else hi = m-1;
cur_dist = m;
}
jump((lo - cur_dist + n) % n);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Output is correct |
2 |
Correct |
0 ms |
208 KB |
Output is correct |
3 |
Incorrect |
0 ms |
208 KB |
Too many queries. |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
Too many queries. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Output is correct |
2 |
Correct |
0 ms |
208 KB |
Output is correct |
3 |
Incorrect |
0 ms |
208 KB |
Too many queries. |
4 |
Halted |
0 ms |
0 KB |
- |