Problem adjlist
User ZiXin
Submission Time 2023-11-10 15:22:28
Score 0
Max Time N/A
Max Memory N/A

Compile Error

adjlist.cpp: In function ‘int main()’:
adjlist.cpp:15:26: error: ‘__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type’ {aka ‘struct std::pair<int, int>’} has no member named ‘push_back’
15 | adjacencyList[a].push_back(b);
| ^~~~~~~~~
adjlist.cpp:16:26: error: ‘__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type’ {aka ‘struct std::pair<int, int>’} has no member named ‘push_back’
16 | adjacencyList[b].push_back(a);
| ^~~~~~~~~
adjlist.cpp:21:34: error: no matching function for call to ‘begin(std::pair<int, int>&)’
21 | for (auto cur: adjacencyList[i]) {
| ^
In file included from /usr/include/c++/9/bits/range_access.h:36,
from /usr/include/c++/9/string:54,