Problem examstress
User PlayVoltz
Submission Time 2024-05-08 12:46:46
Score 0
Max Time N/A
Max Memory N/A

Compile Error

examstress.cpp: In function ‘int32_t main()’:
examstress.cpp:37:21: error: no match for ‘operator[]’ (operand types are ‘std::map<std::__cxx11::basic_string<char>, bool>’ and ‘long long int’)
37 | while(n--)cin>>a, m[a]=!m[a];
| ^
In file included from /usr/include/c++/9/map:61,
from examstress.cpp:5:
/usr/include/c++/9/bits/stl_map.h:490:7: note: candidate: ‘std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::__cxx11::basic_string<char>; _Tp = bool; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, bool> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = bool; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = std::__cxx11::basic_string<char>]’
490 | operator[]