| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1308680 | raineyj | Lost in the cycle (IOI19_cycle) | C++20 | 0 ms | 0 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);
}
}
