# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
28584 | Official Fan of ACG (#68) | LR Springboard (FXCUP2_springboard) | C++14 | 3 ms | 1132 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |