Submission #28584

#TimeUsernameProblemLanguageResultExecution timeMemory
28584Official Fan of ACG (#68)LR Springboard (FXCUP2_springboard)C++14
1 / 1
3 ms1132 KiB
#include "springboard.h" void Reorder(int N) { int x, p, flip; if (N == 1){ flip = PutBall(1); if (flip == -1) PutBall(1); } else if (N == 2){ flip = PutBall(1); if (flip == -1) flip = PutBall(1); if (flip == -1) flip = PutBall(1); } else if (N == 3){ flip = PutBall(1); if (flip == -1) flip = PutBall(1); if (flip == -1) flip = PutBall(1); if (flip == -1) flip = PutBall(1); } else{ flip = PutBall(N / 2); p = N / 2; if (N % 2 == 0){ while (p > 1){ if (flip == 1) flip = PutBall(N + 1 - p); else flip = PutBall(p); p = (p + 1) / 2; } if (flip == 1) flip = PutBall(N); else flip = PutBall(1); } else{ while (p > 1){ if (flip == 1) flip = PutBall(N + 1 - p); else flip = PutBall(p); p = (p + 1) / 2; } if (flip == 1) flip = PutBall(N); else flip = PutBall(1); } if (flip == -1) PutBall(1); } }

Compilation message (stderr)

springboard.cpp: In function 'void Reorder(int)':
springboard.cpp:4:6: warning: unused variable 'x' [-Wunused-variable]
  int x, p, flip;
      ^
#Verdict Execution timeMemoryGrader output
Fetching results...