Submission #376003

#TimeUsernameProblemLanguageResultExecution timeMemory
376003wind_reaperCave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "cave.h"

using namespace std;

const int MXN = 5001;
int n;
int fincolorswitch[MXN], q[MXN], door[MXN];
vector<bool> found(MXN);

int tryCombination(int S[]){
	return 0;
}

void answer(int S[], int D[]){
	return;
}
bool open(int last, int looking){
	return (last == -1) | (last > looking);
}

void dnc(int leftSwitch, int rightSwitch, int targetDoor, int color){
	if(leftSwitch == rightSwitch){
		door[leftSwitch] = targetDoor;
		fincolorswitch[leftSwitch] = color;
		found[leftSwitch] = 1;
		return;
	}

	memset(q, 0, sizeof q);
	int mid = (leftSwitch + rightSwitch) >> 1;

	for(int i = leftSwitch; i <= mid; i++)
		q[i] = color;
	for(int i = mid+1; i <= rightSwitch; i++)
		q[i] = color^1;

	for(int i = 0; i < n; i++)
		if(found[i])
			q[i] = fincolorswitch[i];

	if(open(tryCombination(q), targetDoor))
		dnc(leftSwitch, mid, targetDoor, color);
	else dnc(mid+1, rightSwitch, targetDoor, color);
}

int getCol(int cur){
	memset(q, 0, sizeof q);
	for(int i = 0; i < n; i++)
		if(found[i])
			q[i] = fincolorswitch[i];

	int ans = tryCombination(q);
	if(open(ans, cur)) return 0;

	return 1;
}

void exploreCave(int N){
	n = N;

	for(int i = 0; i < n; i++){
		int col = getCol(i);
		dnc(0, n-1, i, col);
	}

	answer(fincolorswitch, door);
}

Compilation message (stderr)

/tmp/cc2J2Fzq.o: In function `tryCombination':
cave.cpp:(.text+0x0): multiple definition of `tryCombination'
/tmp/ccAdKm0p.o:grader.c:(.text+0x80): first defined here
/tmp/cc2J2Fzq.o: In function `answer':
cave.cpp:(.text+0x10): multiple definition of `answer'
/tmp/ccAdKm0p.o:grader.c:(.text+0x0): first defined here
collect2: error: ld returned 1 exit status