Submission #28534

# Submission time Handle Problem Language Result Execution time Memory
28534 2017-07-16T07:05:47 Z Official Fan of ACG(#1221, cseteram, 16silver, pps789) LR Springboard (FXCUP2_springboard) C++
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 + 1 - 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 Incorrect 0 ms 1128 KB Output isn't correct
2 Halted 0 ms 0 KB -