Problem foreveralone
User blob
Submission Time 2023-11-20 10:49:06
Score 0
Max Time N/A
Max Memory N/A

Compile Error

foreveralone.cpp: In function ‘int main()’:
foreveralone.cpp:13:9: error: request for member ‘push_back’ in ‘m.std::map<int, int>::operator[](A)’, which is of non-class type ‘std::map<int, int>::mapped_type’ {aka ‘int’}
13 | m[A].push_back(B);
| ^~~~~~~~~
foreveralone.cpp:14:9: error: request for member ‘push_back’ in ‘m.std::map<int, int>::operator[](B)’, which is of non-class type ‘std::map<int, int>::mapped_type’ {aka ‘int’}
14 | m[B].push_back(A);
| ^~~~~~~~~
foreveralone.cpp:21:12: error: request for member ‘empty’ in ‘m.std::map<int, int>::operator[](i)’, which is of non-class type ‘std::map<int, int>::mapped_type’ {aka ‘int’}
21 | if (m[i].empty() || (m[i].size() == 1 && m[i][1] == i)) {
| ^~~~~
foreveralone.cpp:21:29: error: request for member ‘size’ in ‘m.std::map<int, int>::operator[](i)’, which is of non-class type ‘std::map<int, int>::m