Submission #226579

#TimeUsernameProblemLanguageResultExecution timeMemory
226579origami100Lost in the cycle (IOI19_cycle)C++17
100 / 100
6 ms432 KiB
#include <bits/stdc++.h> #include "cycle.h" using namespace std; void escape(int N){ int cur = 0; int l = 0, r = N - 1; bool pre = jump(0); while(l + 1 < r){ int m = (l + r) / 2; bool res; if(cur > m){ res = jump(N - cur + m); }else{ res = jump(m - cur); } cur = m; if(res && pre){ if(m == N / 2){ r = m; }else{ l = m; } }else if(pre && !res){ r = m - 1; }else if(!pre && res){ l = m; }else{ r = m - 1; } } if(l == r){ if(cur > l){ jump(N - cur + l); }else{ jump(l - cur); } }else{ if(cur > l){ jump(N - cur + l); }else{ jump(l - cur); } if(jump(1)){ return; }else{ jump(N - 1); } } return; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...