Submission #28555

# Submission time Handle Problem Language Result Execution time Memory
28555 2017-07-16T07:17:50 Z Official Fan of ACG(#1221, cseteram, 16silver, pps789) LR Springboard (FXCUP2_springboard) C++14
0 / 1
0 ms 1128 KB
#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 == 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;
		while (p > 0){
			if (flip == 1) flip = PutBall(N - p);
			else flip = PutBall(p);
			p /= 2;
		}
		if (flip == -1) PutBall(1);
	}
	
}

Compilation message

springboard.cpp: In function 'void Reorder(int)':
springboard.cpp:4:6: warning: unused variable 'x' [-Wunused-variable]
  int x, p, flip;
      ^
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1128 KB Output is correct
2 Correct 0 ms 1128 KB Output is correct
3 Incorrect 0 ms 1128 KB Output isn't correct
4 Halted 0 ms 0 KB -