Submission #55670

#TimeUsernameProblemLanguageResultExecution timeMemory
55670leejseoCave (IOI13_cave)C++98
Compilation error
0 ms0 KiB
#include "cave.h"
#include <vector>
using namespace std;

vector<int> L;


int S[5001], D[5001];
bool DONE[5001];

int binary(int s, int e, int i, int prev){
	if (s == e) return s;
	int mid = (s+e) >> 1;
	for (int i=s; i<=mid; i++) S[L[i]] ^= 1; 
	int res = tryCombination(S);
	if ((res == i) == (prev == i)) return binary(mid+1, e, i, res);
	return binary(s, mid, i, res);
}

void exploreCave(int N) {
    //what is cooected to 0?
	for (int i=0; i<N; i++){
		L.clear();
		for (int j=0; j<N; j++){
			if (!DONE[j]) L.push_back(j);
		}
		int m = j.size();
		for (int j=0; j<m; j++) S[L[j]] = 0;
		int prev = tryCombination(S);
		int res = L[binary(s, e, i, prev)];
		D[res] = i;
		if (tryCombination(S) > i) S[res] ^= 1;
		DONE[res] = 1;
	}	
}

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:27:11: error: 'j' was not declared in this scope
   int m = j.size();
           ^
cave.cpp:30:22: error: 's' was not declared in this scope
   int res = L[binary(s, e, i, prev)];
                      ^
cave.cpp:30:25: error: 'e' was not declared in this scope
   int res = L[binary(s, e, i, prev)];
                         ^