Problem | adjlist |
---|---|
User | yongteckrice |
Submission Time | 2023-04-29 17:12:09 |
Score | 0 |
Max Time | N/A |
Max Memory | N/A |
Owl Get a Life
adjlist.cpp: In function ‘int main()’:
adjlist.cpp:17:12: error: cannot convert ‘std::vector<int>’ to ‘std::map<int, int>::mapped_type’ {aka ‘int’} in assignment
17 | mp[a] = v;
| ^
| |
| std::vector<int>
adjlist.cpp:21:10: error: request for member ‘push_back’ in ‘mp.std::map<int, int>::operator[](a)’, which is of non-class type ‘std::map<int, int>::mapped_type’ {aka ‘int’}
21 | mp[a].push_back(b)
| ^~~~~~~~~
adjlist.cpp:27:19: error: ‘begin’ was not declared in this scope
27 | for(auto k: mp[i])
| ^
adjlist.cpp:27:19: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
from adjlist.cpp:1:
/usr/include/c++/9/valarray:1224:5: note: ‘std::begin’
1224 | begin(const valarray<_Tp>& __va)
| ^~~~~
In file includ