Submission #208640

#TimeUsernameProblemLanguageResultExecution timeMemory
208640eriksuenderhaufLost in the cycle (IOI19_cycle)C++17
100 / 100
14 ms504 KiB
#include "bits/stdc++.h" #include "cycle.h" using namespace std; int n; void solve(int idx, int fl) { //cerr << idx << " " << fl << "\n"; idx %= n; if (idx == (fl^1)) { if (idx) jump(n-idx); return; } if (fl) { int x = n - idx + 1; if (jump(x / 2)) solve(idx + x / 2, 1); else solve(x / 2, 0); } else { int x = idx; if (jump(n-idx + x/2)) solve(n - (x+1)/2 + 1, 1); else solve(x/2, 0); } } void escape(int x) { n = x; if (jump(0)) solve(n-n/2, 1); else solve(n-(n/2+1), 0); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...