| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 348005 | laoriu | Lost in the cycle (IOI19_cycle) | C++14 | 1 ms | 364 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 <bits/stdc++.h>
#include "cycle.h"
using namespace std;
void escape(int n){
    int st=0;
    if(jump(0)){
        if(jump(1)){
            st=1;
            int b=1,e=n/2,ans;
            while(b<=e){
                int m=b+e>>1;
                if(jump((m-st+n)%n)){
                    b=m+1;ans=m;
                }
                else e=m-1;
                st=m;
            }
            jump((ans-st+n)%n);
        }
        else {
            jump(n-1);return;
        }
    }
    else{
            jump(n/2);
            int b=1,e=n/2,ans;
            while(b<=e){
                int m=b+e>>1;
                if(jump((m-st+n)%n)){
                    b=m+1;ans=m;
                }
                else e=m-1;
                st=m;
            }
            jump((ans-st+n)%n);
    }
}
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... | ||||
