# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
251626 | cjoa | Lost in the cycle (IOI19_cycle) | C++14 | 1 ms | 384 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 "cycle.h"
#include <cstdio>
#include <cassert>
void escape(int n) {
// if (n == 2) {
// bool res = jump(1);
// assert(res);
// }
bool res = jump(0);
if (!res) {
res = jump(n/2);
assert(res);
}
int d = 1;
while (d*4 <= n)
d *= 2;
// fprintf(stderr, "d:%d\n", d);
int offset = 0;
for (; d > 0; d /= 2) {
bool res = jump(offset + d);
if (res) {
offset = 0;
}
else {
offset = n-d;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |