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

Compile Error

foreveralone.cpp: In function ‘int main()’:
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>::mapped_type’ {aka ‘int’}
21 | if (m[i].empty() || (m[i].size() == 1 && m[i][1] == i)) {
| ^~~~
foreveralone.cpp:21:50: error: invalid types ‘std::map<int, int>::mapped_type {aka int}[int]’ for array subscript
21 | if (m[i].empty() || (m[i].size() == 1 && m[i][1] == i)) {
| ^