제출 #385116

#제출 시각아이디문제언어결과실행 시간메모리
385116Azimjon동굴 (IOI13_cave)C++17
컴파일 에러
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); }

컴파일 시 표준 에러 (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)) {
      |                                        ^~~~