Submission #228622

#TimeUsernameProblemLanguageResultExecution timeMemory
228622huangqrLost in the cycle (IOI19_cycle)C++14
100 / 100
5 ms416 KiB
#include<bits/stdc++.h> #include "cycle.h" void escape(int n) { int x=floor(log2(n)),r=0,a=0,to_jump; for(int i=x;i>=0;i--){ int t=(1<<i); to_jump=(r+t)%n; bool yn=jump(to_jump); if(yn){ // cerr<<"Jump "<<to_jump<<" yes, r=0\n"; r=0; } else{ // cerr<<"Jump "<<to_jump<<" no, r="<<n-t<<"\n"; r=n-t; } } jump(r); }

Compilation message (stderr)

cycle.cpp: In function 'void escape(int)':
cycle.cpp:5:27: warning: unused variable 'a' [-Wunused-variable]
  int x=floor(log2(n)),r=0,a=0,to_jump;
                           ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...