Submission #258632

#TimeUsernameProblemLanguageResultExecution timeMemory
258632ipaljakLost in the cycle (IOI19_cycle)C++14
100 / 100
1 ms256 KiB
#include "cycle.h" #include <cassert> void escape(int n) { int pow2 = 1; while (2 * pow2 <= n) pow2 *= 2; pow2 /= 2; if (!jump(0)) assert(jump(n / 2)); bool last_ok = true; for (; pow2 > 0; pow2 /= 2) { if (last_ok) last_ok = jump(pow2); else last_ok = jump(n - pow2); } if (!last_ok) jump(n - 1); return; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...