Submission #307937

#TimeUsernameProblemLanguageResultExecution timeMemory
307937urd05Lost in the cycle (IOI19_cycle)C++14
100 / 100
1 ms256 KiB
#include "cycle.h" #include <bits/stdc++.h> using namespace std; void escape(int n) { long long lo=0; long long hi=n; long long prev=0; if (!jump(0)) { lo=n/2; } while (lo+1<hi) { long long mid=(lo+hi)/2; long long move=n+mid-prev; move%=n; if (jump(move)) { lo=mid; } else { hi=mid; } prev=mid; } jump((n+lo-prev)%n); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...