Problem | labs |
---|---|
User | yqiiiiiii |
Submission Time | 2025-06-18 17:09:03 |
Score | 0 |
Max Time | N/A |
Max Memory | N/A |
Owl Get a Life
labs.cpp: In function ‘int main()’:
labs.cpp:14:6: error: no match for ‘operator[]’ (operand types are ‘std::map<int, int>’ and ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’})
14 | mp[tr] = n;
| ^
In file included from /usr/include/c++/9/map:61,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:81,
from labs.cpp:1:
/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 = int; _Tp = int; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = int]’
490 | operator[](const key_type& __k)
| ^~~~~~~~
/usr/include/c++/9/bits/stl_map.h:490:34: note: no known conver