Submission #1263237

#TimeUsernameProblemLanguageResultExecution timeMemory
1263237bluevioletCave (IOI13_cave)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int s[5009], d[5009]; set<int> st; void exploreCave(int N) { st.clear(); for (int i = 0; i < N; i++) { s[i] = 0; d[i] = 0; st.insert(i); } while (true) { int firstClosed = tryCombination(s); if (firstClosed == -1) break; for (auto it = st.begin(); it != st.end();) { int pos = *it; s[pos] ^= 1; int pp = tryCombination(s); if (pp == -1) break; if (pp < firstClosed) { s[pos] ^= 1; d[pos] = pp; it = st.erase(it); } else if (pp > firstClosed) { d[pos] = firstClosed; it = st.erase(it); break; } else { s[pos] ^= 1; ++it; } } } answer(s, d); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:18:27: error: 'tryCombination' was not declared in this scope
   18 |         int firstClosed = tryCombination(s);
      |                           ^~~~~~~~~~~~~~
cave.cpp:41:5: error: 'answer' was not declared in this scope
   41 |     answer(s, d);
      |     ^~~~~~