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 "cycle.h"
#include <cstdio>
#include <cassert>
void escape(int n) {
bool res = jump(0);
if (!res) {
res = jump(n/2);
assert(res);
}
int d = 1;
while (d*4 < n-1)
d *= 2;
// fprintf(stderr, "d:%d\n", d);
int offset = 0;
for (; d > 0; d /= 2) {
bool res = jump(offset + d);
if (res) {
offset = 0;
}
else {
offset = n-d;
}
}
if (offset != 0)
jump(offset);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |