Submission #1080766

#TimeUsernameProblemLanguageResultExecution timeMemory
1080766jcelinCave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int,int> ii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<ll> vll;
typedef vector<pll> vpll;

#define PB push_back
#define PF push_front
#define PPB pop_back
#define PPF pop_front
#define X first
#define Y second
#define MP make_pair
#define all(x) (x).begin(), (x).end()

const int mod = 1e9 + 7; //998244353;
const int inf = 1e9 + 7;
const ll INF = 1e18 + 7;
const int logo = 20;
const int MAXN = 1e6 + 7;
const int off = 1 << logo;
const int trsz = off << 1;
const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, -1, 1};

vi s, d;

void exploreCave(int n){
	s.resize(n);
	d.resize(n, -1);
	int lst = tryCombination(s);
	for(int i=0; i<n; i++){
		int lo = 0, hi = n - 1;
		while(lo < hi){
			int mid = (lo + hi) / 2;
			for(int j=lo; j<=mid; j++) if(d[j] == -1) s[j] ^= 1;
			int vl = tryCombination(s);
			if((vl != i and lst != i) or (vl == i and lst == i)) lo = mid + 1;
			else hi = mid;
			lst = vl;
		}
		d[lo] = i;
		if(lst == i) s[lo] ^= 1;
		lst = tryCombination(s);
	}
	
	answer(s, d);
}

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:36:12: error: 'tryCombination' was not declared in this scope
   36 |  int lst = tryCombination(s);
      |            ^~~~~~~~~~~~~~
cave.cpp:52:2: error: 'answer' was not declared in this scope
   52 |  answer(s, d);
      |  ^~~~~~