Submission #866669

#TimeUsernameProblemLanguageResultExecution timeMemory
866669iris2617Lost in the cycle (IOI19_cycle)C++14
100 / 100
1 ms344 KiB
#include "cycle.h" void escape(int n) { if(n==2) { jump(1); return; } int cur=0; auto qry=[&](int a) { int x=(a-cur+n)%n; cur=a%n; return jump(x); }; if(!qry(0)) cur=n-n/2; int ans=0; for(int i=29;i>=0;i--) if(qry(ans+(1<<i))) ans+=(1<<i); qry(ans); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...