Problem adjlist
User yongteckrice
Submission Time 2023-04-29 17:12:00
Score 0
Max Time N/A
Max Memory N/A

Compile Error

adjlist.cpp: In function ‘int main()’:
adjlist.cpp:14:18: error: could not convert ‘(mp.std::map<int, int>::find(a) = mp.std::map<int, int>::end())’ from ‘std::map<int, int>::iterator’ {aka ‘std::_Rb_tree_iterator<std::pair<const int, int> >’} to ‘bool’
14 | if (mp.find(a) = mp.end())
| ~~~~~~~~~~~^~~~~~~~~~
| |
| std::map<int, int>::iterator {aka std::_Rb_tree_iterator<std::pair<const int, int> >}
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_bac