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"
void escape(int n) {
int half = n >> 1;
int prev = 0;
int l = 0, r = n - 1;
int toM = -1;
while (l <= r) {
int m = (l + r) >> 1;
if (jump((n - prev + m) % n)) {
r = m - 1;
toM = m;
}
else l = m + 1;
prev = m;
}
jump((n-prev+toM+half)%n);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |