Submission #678014

#TimeUsernameProblemLanguageResultExecution timeMemory
678014hello_there_123Cave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
//#include "cave.h"
#include <bits/stdc++.h>
using namespace std;
int tryCombination(int S[]);
void answer(int A[],int B[]);
void exploreCave(int N) {
	int comb[N+3];
	int link[N+3];
	memset(comb,-1,sizeof(comb));
	memset(link,-1,sizeof(link));
	for(int i=0;i<N;i++){
		int tr[N+3];
		for(int j=0;j<N;j++){
			tr[j] = comb[j];
		}
		for(int j=0;j<N;j++){
			if(tr[j] == -1) tr[j] = 0;
		}
		int cor;
		if(tryCombination(tr)>i) cor = 0;
		else cor = 1;
		int lo = 0;
		int hi = N-1;
		while(lo<=hi){
			int X = (lo+hi)/2;
			for(int j=lo;j<X;j++){
				if(comb[j] == -1) tr[j] = cor;
			}
			for(int j=X;j<hi;j++){
				if(comb[j] == -1) tr[j] = 1-cor;
			}
			if(tryCombination(tr)>i){
				hi = X-1;
			}
			else lo = X+1;
		}
		link[lo] = i;
		comb[lo] = cor;
		
		
	}
  
 
 
 
    answer(comb, link);
}

Compilation message (stderr)

/usr/bin/ld: /tmp/cc1dvKVu.o: in function `main':
grader.c:(.text.startup+0x10): undefined reference to `exploreCave'
/usr/bin/ld: /tmp/ccyP5Sly.o: in function `exploreCave(int)':
cave.cpp:(.text+0x1bf): undefined reference to `tryCombination(int*)'
/usr/bin/ld: cave.cpp:(.text+0x23f): undefined reference to `tryCombination(int*)'
/usr/bin/ld: cave.cpp:(.text+0x288): undefined reference to `answer(int*, int*)'
collect2: error: ld returned 1 exit status