Submission #251622

#TimeUsernameProblemLanguageResultExecution timeMemory
251622cjoaLost in the cycle (IOI19_cycle)C++14
33 / 100
1 ms384 KiB
#include "cycle.h" #include <cstdio> #include <cassert> void escape(int n) { bool res = jump(0); if (!res) { res = jump(n/2); assert(res); } int d = 1; while (d*4 < n-1) 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; } } if (offset != 0) jump(offset); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...