제출 #523677

#제출 시각아이디문제언어결과실행 시간메모리
523677bebecanvas동굴 (IOI13_cave)C++14
컴파일 에러
0 ms0 KiB
void exploreCave(int N) {
	
	int s[N];
	int d[N];
	for(int i=0; i<N; i++){d[i]=-1;}

	for(int i=0; i<N; i++){
		int l=0;
		int r=N-1;
		int test[N];
		for(int i=0; i<N; i++){test[i]=0;}
		for(int i=0; i<N; i++){if(d[i]!=-1){test[i]= s[i];}}
		int lol= tryCombination(test);
		while(l<=r){
			int mid= l+(r-l)/2;
			for(int j=mid; j<=r; j++){if(d[j]==-1){test[j]+= 1; test[j]%=2;}}
			int loll= tryCombination(test);
			if(lol==i){
				if(loll>lol){
					l= mid;
				}else{
					r= mid-1;
				}
			}else{
				if(loll==i){
					l= mid;
				}else{
					r= mid-1;
				}
			}
		}
		d[l]=i;
		if(lol==i){s[l]=1;}else{s[l]=0;}
	}
	
    
    answer(s, d);
	
}

컴파일 시 표준 에러 (stderr) 메시지

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:13:12: error: 'tryCombination' was not declared in this scope
   13 |   int lol= tryCombination(test);
      |            ^~~~~~~~~~~~~~
cave.cpp:37:5: error: 'answer' was not declared in this scope
   37 |     answer(s, d);
      |     ^~~~~~