답안 #28778

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
28778 2017-07-17T07:38:15 Z kriii LR Springboard (FXCUP2_springboard) C++14
컴파일 오류
0 ms 0 KB
#include "springboard.h"
 
void Reorder(int N) {
	PutBall((N+1)/2);
	int l,r;
	if (PutBall((N+1)/2) == -1){
		l = (N+1)/2;
		r = N;
	}
	else{
		l = 0;
		r = (N+1)/2;
	}
 
	while (cand.size() > 1){
		int step = (r - l + 1) / 2;
		if (r != N) step = N + 1 - step;
 		l = (l + step) % (N+1);
		r = (r + step) % (N+1);
		int d = PutBall(step);
		if (d == 1) r = N;
		else l = 0;
	}
 
	int push = N-l+1;
	if (1 <= push && push <= N) PutBall(push);
}

Compilation message

springboard.cpp: In function 'void Reorder(int)':
springboard.cpp:15:9: error: 'cand' was not declared in this scope
  while (cand.size() > 1){
         ^