Submission #976015

#TimeUsernameProblemLanguageResultExecution timeMemory
976015SiliconSquaredLost in the cycle (IOI19_cycle)C++14
100 / 100
1 ms596 KiB
#include "cycle.h" void escape(int n) { long long a,b,c,d; if (!jump(0)){ jump(n/2); } a=0; b=n/2; c=0; while (b-a>1){ d=(a+b)/2-c; if (d<0){d+=n;} c=(a+b)/2; if (jump(d)){ a=c; }else{ b=c-1; } } if (a==b){ d=a-c; if (d<0){d+=n;} jump(d); }else{ d=b-c; if (d<0){d+=n;} if (!jump(d)){ jump(n-1); } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...