답안 #15969

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
15969 2015-08-03T18:31:57 Z ggoh 동굴 (IOI13_cave) C++
컴파일 오류
0 ms 0 KB
#include<cstdio>
#include "cave.h"

int D[5555],S[5555],s[5555];
bool C[5555];
void exploreCave(int N)
{
	int i,p,q,h,back,ima;
	for(i=0;i<N;i++)
	{
		p=0;q=N;
		for(int j=0;j<N/2;j++)
		{
			if(C[j])s[j]=S[j];
			else s[j]=0;
		}
		back=tryCombination(s);
		if(back==-1)back=N;
		while(p!=q-1)
		{
			h=(p+q)/2;
			for(int j=p;j<h;j++)
			{
				if(C[j])s[j]=S[j];
				else s[j]=1-s[j];
			}
			ima=Combination(s);
			if(ima==-1)ima=N;
			if((ima>i&&back>i)||(ima==i&&back==i))
			{
				back=ima;
				p=h;
			}
			else
			{
				back=ima;
				q=h;
			}
		}
		if(back==i)S[p]=1-s[p];
		else S[p]=s[p];
		D[p]=i;
		C[p]=1;
	}
	answer(S,D);
}

Compilation message

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:27:8: error: 'Combination' was not declared in this scope
    ima=Combination(s);
        ^~~~~~~~~~~
cave.cpp:27:8: note: suggested alternative: 'tryCombination'
    ima=Combination(s);
        ^~~~~~~~~~~
        tryCombination