Submission #143471

#TimeUsernameProblemLanguageResultExecution timeMemory
143471dolphingarlicLost in the cycle (IOI19_cycle)C++14
100 / 100
3 ms392 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...