Submission #1308681

#TimeUsernameProblemLanguageResultExecution timeMemory
1308681raineyjLost in the cycle (IOI19_cycle)C++20
0 / 100
1 ms332 KiB
#include <bits/stdc++.h>
#include "cycle.h"
using namespace std;

void escape(int n)
{
    if(n==2) jump(1);
    else
    {
        int l=0, r=n, prev=0;
        bool last=false;
        while(l<r)
        {
            int mid=(l+r)/2;
            if(jump(mid+prev))
            {
                prev+=mid;
                r=mid;
                last=true;
            }
            else 
            {
                l=mid+1;
                prev-=mid;
                last=false;
            }
        }
        if(last==true) jump(n/2);
        else jump((n/2)+1);
    }
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...