Kaimynų kaimynai

Taškai: 0

Compile: FAIL

kaimynu_kaimynai.cpp: In function ‘int main()’: kaimynu_kaimynai.cpp:40:45: error: no match for ‘operator[]’ (operand types are ‘std::map<std::__cxx11::basic_string<char>, int>’ and ‘int’) 40 | kaimynai2.push_back(kaimynai[b]) | ^ In file included from /usr/include/c++/11/map:61, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:81, from kaimynu_kaimynai.cpp:1: /usr/include/c++/11/bits/stl_map.h:492: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 = int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = std::__cxx11::basic_string<char>]’ 492 | operator[](const key_type& __k) | ^~~~~~~~ /usr/include/c++/11/bits/stl_map.h:492:34: note: no known conversion for argument 1 from ‘int’ to ‘const key_type&’ {aka ‘const std::__cxx11::basic_string<char>&’} 492 | operator[](const key_type& __k) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/11/bits/stl_map.h:512:7: note: candidate: ‘std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](std::map<_Key, _Tp, _Compare, _Alloc>::key_type&&) [with _Key = std::__cxx11::basic_string<char>; _Tp = int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = std::__cxx11::basic_string<char>]’ 512 | operator[](key_type&& __k) | ^~~~~~~~ /usr/include/c++/11/bits/stl_map.h:512:29: note: no known conversion for argument 1 from ‘int’ to ‘std::map<std::__cxx11::basic_string<char>, int>::key_type&&’ {aka ‘std::__cxx11::basic_string<char>&&’} 512 | operator[](key_type&& __k) | ~~~~~~~~~~~^~~

nr.resulttimemessage