Problem | adjlist |
---|---|
User | yongteckrice |
Submission Time | 2023-04-29 17:10:17 |
Score | 0 |
Max Time | N/A |
Max Memory | N/A |
Owl Get a Life
adjlist.cpp: In function ‘int main()’:
adjlist.cpp:14:7: error: no match for ‘operator!’ (operand type is ‘std::map<int, int>::iterator’ {aka ‘std::_Rb_tree_iterator<std::pair<const int, int> >’})
14 | if (!mp.find(a))
| ^~~~~~~~~~~
adjlist.cpp:14:7: note: candidate: ‘operator!(bool)’ <built-in>
adjlist.cpp:14:7: note: no known conversion for argument 1 from ‘std::map<int, int>::iterator’ {aka ‘std::_Rb_tree_iterator<std::pair<const int, int> >’} to ‘bool’
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]