Submission #1085019

#TimeUsernameProblemLanguageResultExecution timeMemory
1085019SunbaeCave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> //#include "cave.h" using namespace std; const int N = 5005; int n, s[N], d[N], a[N]; bool vis[N]; void exploreCave(int nn){ n = nn; fill(s, s+n, 0); fill(vis, vis+n, false); for(int i = 0; i<n; ++i){ // i is door to open for(int j = 0; j<n; ++j) a[i] = (vis[j])? s[j] : 0; int door = tryCombination(a); if(door == -1) door = n; int col = (door > i) ? 0 : 1; int low = 0, high = n-1, idx; for(int j = 0; j<n; ++j) a[i] = (vis[j])? s[j] : 0; while(low <= high){ int mid = low + ((high-low)>>1); for(int j = low; j<=high; ++j){ if(vis[j]) continue; if(j <= mid) a[j] = col; else a[j] = col^1; } int door = tryCombination(a); if(door == -1) door = n; if(door > i){ high = mid; idx = mid; }else{ low = mid+1; } } s[idx] = col; d[idx] = i; vis[idx] = true; } answer(s, d); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:13:14: error: 'tryCombination' was not declared in this scope
   13 |   int door = tryCombination(a); if(door == -1) door = n;
      |              ^~~~~~~~~~~~~~
cave.cpp:35:2: error: 'answer' was not declared in this scope
   35 |  answer(s, d);
      |  ^~~~~~