Kaimynų kaimynai
- [1] 2023-11-16 16:11 (0)
- [2] 2023-11-16 18:40 (60)
- [3] 2023-11-16 20:54 (60)
- [4] 2023-11-17 08:51 (60)
- [5] 2023-11-25 17:42 (0)
- [6] 2024-02-03 11:42 (60)
- [7] 2024-02-03 11:48 (60)
- [8] 2024-02-03 11:51 (100)
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. | result | time | message |
---|