QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#584247 | #7700. Split Decisions | MaMengQi | Compile Error | / | / | C++20 | 1.4kb | 2024-09-23 10:52:04 | 2024-09-23 10:52:04 |
Due to the privacy settings of the submitter, you are not allowed to view this code.
Details
answer.code: In function ‘void solve()’: answer.code:50:51: error: no match for ‘operator[]’ (operand types are ‘std::map<std::map<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >, std::pair<long long int, long long int> >, long long int>’ and ‘<brace-enclosed initializer list>’) 50 | um[{{s1,s2},{len1,k}}]++; | ^ In file included from /usr/include/c++/13/map:63, from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:152, from answer.code:1: /usr/include/c++/13/bits/stl_map.h:504:7: note: candidate: ‘std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::map<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >, std::pair<long long int, long long int> >; _Tp = long long int; _Compare = std::less<std::map<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >, std::pair<long long int, long long int> > >; _Alloc = std::allocator<std::pair<const std::map<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >, std::pair<long long int, long long int> >, long long int> >; mapped_type = long long int; key_type = std::map<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >, std::pair<long long int, long long int> >]’ 504 | operator[](const key_type& __k) | ^~~~~~~~ /usr/include/c++/13/bits/stl_map.h:504:34: note: no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const std::map<std::map<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >, std::pair<long long int, long long int> >, long long int>::key_type&’ {aka ‘const std::map<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >, std::pair<long long int, long long int> >&’} 504 | operator[](const key_type& __k) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/13/bits/stl_map.h:524:7: note: candidate: ‘std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = std::map<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >, std::pair<long long int, long long int> >; _Tp = long long int; _Compare = std::less<std::map<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >, std::pair<long long int, long long int> > >; _Alloc = std::allocator<std::pair<const std::map<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >, std::pair<long long int, long long int> >, long long int> >; mapped_type = long long int; key_type = std::map<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >, std::pair<long long int, long long int> >]’ 524 | operator[](key_type&& __k) | ^~~~~~~~ /usr/include/c++/13/bits/stl_map.h:524:29: note: no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘std::map<std::map<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >, std::pair<long long int, long long int> >, long long int>::key_type&&’ {aka ‘std::map<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >, std::pair<long long int, long long int> >&&’} 524 | operator[](key_type&& __k) | ~~~~~~~~~~~^~~