Submission #385116

#TimeUsernameProblemLanguageResultExecution timeMemory
385116AzimjonCave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; void exploreCave(int N) { int s[N], d[N]; memset(s, 0, sizeof(s)); memset(d, -1, sizeof(d)); vector<int> r; for (int i = 0; i < N; i++) { r.push_back(tryCombination(s)); int l = 0, r = N - 1; while (l < r) { int m = (l + r) / 2; for (int j = l; j <= m; j++) { if (d[j] == -1) s[j] ^= 1; } r.push_back(tryCombination(s)); if ((r.back() == i) ^ (r[r.size() - 2] == i)) { r = m; } else { l = m; } } d[l] = i; s[l] ^= 1; } answer(s, d); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:26:15: error: request for member 'push_back' in 'r', which is of non-class type 'int'
   26 |             r.push_back(tryCombination(s));
      |               ^~~~~~~~~
cave.cpp:28:20: error: request for member 'back' in 'r', which is of non-class type 'int'
   28 |             if ((r.back() == i) ^ (r[r.size() - 2] == i)) {
      |                    ^~~~
cave.cpp:28:40: error: request for member 'size' in 'r', which is of non-class type 'int'
   28 |             if ((r.back() == i) ^ (r[r.size() - 2] == i)) {
      |                                        ^~~~