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){
if (n==2){ jump(1); return; }
int ret = jump(n/2); if (ret==false) assert(jump(n/2));
int l = 0,r = n/2+1,mid,now = 0,nxt;
while(abs(l-r)>1){
mid=(l+r)/2,nxt=(now+n-1)/n*n+mid,ret=jump((nxt-now)%n),now=nxt;
if (ret) l = mid;
else r = mid;
now = nxt;
}
nxt=(now+n-1)/n*n+l,ret=jump((nxt-now)%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... |