Problem adjlist
User denzelong8811
Submission Time 2025-04-05 21:49:21
Score 0
Max Time N/A
Max Memory N/A

Compile Error

adjlist.cpp: In function ‘int main()’:
adjlist.cpp:13:16: error: no match for ‘operator[]’ (operand types are ‘std::__cxx11::list<std::__cxx11::list<int> >’ and ‘int’)
13 | adjList[a].push_back(b);
| ^
adjlist.cpp:14:16: error: no match for ‘operator[]’ (operand types are ‘std::__cxx11::list<std::__cxx11::list<int> >’ and ‘int’)
14 | adjList[b].push_back(a);
| ^
adjlist.cpp:18:34: error: no match for ‘operator[]’ (operand types are ‘std::__cxx11::list<std::__cxx11::list<int> >’ and ‘int’)
18 | for (int number : adjList[i]) {
| ^