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 <bits/stdc++.h>
using namespace std;
void escape(int n) {
long long lo=0;
long long hi=n;
long long prev=0;
if (!jump(0)) {
lo=n/2;
}
while (lo+1<hi) {
long long mid=(lo+hi)/2;
long long move=n+mid-prev;
move%=n;
if (jump(move)) {
lo=mid;
}
else {
hi=mid;
}
prev=mid;
}
jump((n+lo-prev)%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... |