| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1356997 | toast12 | Lost in the cycle (IOI19_cycle) | C++20 | 0 ms | 400 KiB |
#include "cycle.h"
void escape(int n) {
if (!jump(0)) jump(n/2);
int lo = 0, hi = n/2+1;
int a = 0, b = 0;
bool poss = true;
while (lo < hi) {
int mid = (lo+hi)/2;
// jump mid steps from the original position
int res;
if (poss) res = jump(mid+a);
else res = jump(mid+b);
poss = res;
if (poss) {
a = -mid;
b = 0;
lo = mid+1;
}
else {
a = 0;
b = n-mid;
hi = mid;
}
}
if (!poss) jump(n-1);
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
