Submission #866668

#TimeUsernameProblemLanguageResultExecution timeMemory
866668iris2617Lost in the cycle (IOI19_cycle)C++14
33 / 100
0 ms596 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-(1+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...