제출 #244054

#제출 시각아이디문제언어결과실행 시간메모리
244054crossing0ver자동 인형 (IOI18_doll)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #define vi vector<int> #define fi first #define se second //#define local #ifndef local #include "doll.h" #endif using namespace std; void create_circuit(int M, vi A) { int n = A.size(); vi C(M + 1); vector<vector<int> > F(M+1); int num = 0; C[0] = A[0]; for (int i = 0; i < n; ++i) { if (C[A[i]] == 0) C[A[i]] = -(++num); F[num].pb((i != n ? A[i+1] : 0)); } for (auto i = 1; i <= M; i++) { if (F[i].size() == 0) continue; if (F[i].size() == 1) X.pb(-i), Y.pb(F[i][0]); else X.pb(F[i][0]), Y.pb(F[i][1]); } vector<int> X, Y; answer(C, X, Y); }

컴파일 시 표준 에러 (stderr) 메시지

doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:20:11: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'class std::vector<int>'} has no member named 'pb'
   20 |    F[num].pb((i != n ?  A[i+1] : 0));
      |           ^~
doll.cpp:24:26: error: 'X' was not declared in this scope
   24 |    if (F[i].size() == 1) X.pb(-i), Y.pb(F[i][0]);
      |                          ^
doll.cpp:24:36: error: 'Y' was not declared in this scope
   24 |    if (F[i].size() == 1) X.pb(-i), Y.pb(F[i][0]);
      |                                    ^
doll.cpp:25:9: error: 'X' was not declared in this scope
   25 |    else X.pb(F[i][0]), Y.pb(F[i][1]);
      |         ^
doll.cpp:25:24: error: 'Y' was not declared in this scope
   25 |    else X.pb(F[i][0]), Y.pb(F[i][1]);
      |                        ^