Submission #143970

#TimeUsernameProblemLanguageResultExecution timeMemory
143970nvmdavaLost in the cycle (IOI19_cycle)C++17
100 / 100
4 ms380 KiB
#include "cycle.h" #include <iostream> void escape(int n) { long long N = (long long) n; long long l = 0, r = N, offset = 0, curr = 0; while (l != r) { long long mid = (l + r) / 2; curr = (curr + mid + offset) % N; if (jump((mid + offset) % N)) r = mid; else l = mid + 1; offset = N - mid; } jump((N / 2 + l + offset) % N); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...