# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
228024 | jzh | Lost in the cycle (IOI19_cycle) | C++14 | 0 ms | 0 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>
using namespace std;
void escape (int n){
int x = n, y;
if (jump(0)){
x = n/2;
}
else {
x = n/2;
x *= -1;
}
bool b;
while (abs(x)>0){
y = x;
if (y<0)y+=n;
y%=n;
//cout<<x<<' '<<y<<'\n';
if (jump(y)){
x = abs(x) + x%2;
//cout<<"True\n";
b = true;
x = x/2;
}
else {
x = -1*abs(x);
//cout<<"False\n";
b = false;
x = x/2 - abs(x)%2;
}
//cout<<ans<<'\n';
//x = x/2 + x%2;
}
if (!b)jump(n-1);
}