| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 307954 | sean9892 | Lost in the cycle (IOI19_cycle) | C++14 | 1 ms | 384 KiB |
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"
int distance(int pos,int tar,int n){
return (tar-pos+n)%n;
}
void escape(int n) {
int pos=0;
int N;
N=n/2*2;
if(n&1){
bool x=jump(distance(pos,N,n));
pos=N;
bool y=jump(1);
pos=0;
if(x&&!y){
jump(N);
return;
}
}
int l=0,r=N;
while(l<r){
int m=l+r>>1;
bool x=jump(distance(pos,m,n));
pos=m;
if(x){
l=m;
}
else{
r=m;
}
if(r-l<=3){
break;
}
}
int i;
for(i=r-1;i>=l;i--){
bool x=jump(distance(pos,i,n));
pos=i;
if(x){
break;
}
}
}Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
