답안 #109169

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
109169 2019-05-05T08:25:13 Z tjd229 LR Springboard (FXCUP2_springboard) C++11
0 / 1
3 ms 256 KB
#include "springboard.h"
#include <stdio.h>
void Reorder(int N) {
	int rem = N>>1;
	int dir = PutBall(1+rem);
	int coin = 1;
	while (rem>1) {
		rem >>= 1;
		if (++coin > 16) printf("!!1\n");
		if (dir > 0) dir = PutBall(N - rem + 1);// , printf("put %d, d=%d\n", N - rem + 1, dir);
		else dir = PutBall(1 + rem);// , printf("put %d, d=%d\n", rem, dir);
	}
	if (dir > 0) {
		if (++coin > 16) printf("!!2\n");
		dir=PutBall(N);
		if (dir < 0) {

			if (++coin > 16) printf("!!3\n");
			PutBall(1);
		}
	}
	else {
		if (++coin > 16) printf("!!4\n");
		dir=PutBall(1);
		if (dir < 0) PutBall(1);
	}
}
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 256 KB Output is correct
2 Correct 3 ms 256 KB Output is correct
3 Correct 3 ms 256 KB Output is correct
4 Correct 3 ms 256 KB Output is correct
5 Runtime error 3 ms 256 KB Execution failed because the return code was nonzero
6 Halted 0 ms 0 KB -