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;
using ll=long long;
void escape(int n) {
while(true){
if(jump((n/2+1)%n))break;
}
ll jmp=1;
while(jmp*2<=n/2){
jmp*=2;
}
ll nx=jmp;
while(jmp){
if(jump(nx)){
nx=jmp/2;
}
else{
nx=((jmp/2+n-jmp)%n);
}
jmp/=2;
}
if(nx!=0){
jump(nx);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |