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 <bits/stdc++.h>
#include "cycle.h"
using namespace std;
void escape(int n){
bool chk;
int half = n/2;
if (!jump(half)){
chk = jump(n-half);
}
int l=0, r=half, prevjump=n;
while (l+1<r){
int mid = (l+r)/2;
chk = jump((mid+n-prevjump)%n);
if (chk) l=mid;
else r=mid-1;
prevjump = mid;
}
chk = jump((l+n-prevjump)%n);
if (l+1 == r){
if (!jump(1) || n==2){
chk = jump(n-1);
}
}
return;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |