Problem adjlist
User SioHuang
Submission Time 2023-11-10 14:19:56
Score 0
Max Time N/A
Max Memory N/A

Compile Error

adjlist.cpp: In function ‘int main()’:
adjlist.cpp:12:14: error: request for member ‘push_back’ in ‘g[A]’, which is of non-class type ‘std::vector<int> [51]’
12 | g[A].push_back(B);
| ^~~~~~~~~
adjlist.cpp:13:14: error: request for member ‘push_back’ in ‘g[B]’, which is of non-class type ‘std::vector<int> [51]’
13 | g[B].push_back(A);
| ^~~~~~~~~
adjlist.cpp:17:18: error: no match for ‘operator<<’ (operand types are ‘std::ostream’ {aka ‘std::basic_ostream<char>’} and ‘std::vector<int>’)
17 | cout << j;
| ~~~~ ^~ ~
| | |
| | std::vector<int>
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/9/istream:39,
from /usr/include/c++/9/sstream:38,
from /usr/include/c++/9/complex: