Borderou de evaluare (job #2747533)

Utilizator atudoreimirunaAtudorei Miruna Gabriela atudoreimiruna Data 29 aprilie 2021 12:49:39
Problema Loto Status done
Runda Arhiva de probleme Compilator cpp-64 | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: main.cpp: In function 'int main()': main.cpp:48:23: error: no match for 'operator=' (operand types are 'std::unordered_map<int, numere>::iterator {aka std::__detail::_Node_iterator<std::pair<const int, numere>, false, false>}' and 'int') S2 = s - itr->first; ^~~~~ In file included from /usr/include/c++/6/bits/hashtable.h:35:0, from /usr/include/c++/6/unordered_map:47, from main.cpp:4: /usr/include/c++/6/bits/hashtable_policy.h:331:12: note: candidate: constexpr std::__detail::_Node_iterator<std::pair<const int, numere>, false, false>& std::__detail::_Node_iterator<std::pair<const int, numere>, false, false>::operator=(const std::__detail::_Node_iterator<std::pair<const int, numere>, false, false>&) struct _Node_iterator ^~~~~~~~~~~~~~ /usr/include/c++/6/bits/hashtable_policy.h:331:12: note: no known conversion for argument 1 from 'int' to 'const std::__detail::_Node_iterator<std::pair<const int, numere>, false, false>&' /usr/include/c++/6/bits/hashtable_policy.h:331:12: note: candidate: constexpr std::__detail::_Node_iterator<std::pair<const int, numere>, false, false>& std::__detail::_Node_iterator<std::pair<const int, numere>, false, false>::operator=(std::__detail::_Node_iterator<std::pair<const int, numere>, false, false>&&) /usr/include/c++/6/bits/hashtable_policy.h:331:12: note: no known conversion for argument 1 from 'int' to 'std::__detail::_Node_iterator<std::pair<const int, numere>, false, false>&&' main.cpp:49:27: error: no matching function for call to 'std::unordered_map<int, numere>::count(std::unordered_map<int, numere>::iterator&)' if ( hmap.count(S2) > 0 ) ^ In file included from /usr/include/c++/6/unordered_map:48:0, from main.cpp:4: /usr/include/c++/6/bits/unordered_map.h:868:7: note: candidate: std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::count(const key_type&) const [with _Key = int; _Tp = numere; _Hash = std::hash<int>; _Pred = std::equal_to<int>; _Alloc = std::allocator<std::pair<const int, numere> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type = long unsigned int; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_type = int] count(const key_type& __x) const ^~~~~ /usr/include/c++/6/bits/unordered_map.h:868:7: note: no known conversion for argument 1 from 'std::unordered_map<int, numere>::iterator {aka std::__detail::_Node_iterator<std::pair<const int, numere>, false, false>}' to 'const key_type& {aka const int&}' main.cpp:53:25: error: no match for 'operator[]' (operand types are 'std::unordered_map<int, numere>' and 'std::unordered_map<int, numere>::iterator {aka std::__detail::_Node_iterator<std::pair<const int, numere>, false, false>}') fout << hmap[S2].x << " " << hmap[S2].y << " " << hmap[S2].z; ^ In file included from /usr/include/c++/6/unordered_map:48:0, from main.cpp:4: /usr/include/c++/6/bits/unordered_map.h:903:7: note: candidate: std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type& std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](const key_type&) [with _Key = int; _Tp = numere; _Hash = std::hash<int>; _Pred = std::equal_to<int>; _Alloc = std::allocator<std::pair<const int, numere> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type = numere; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_type = int] operator[](const key_type& __k) ^~~~~~~~ /usr/include/c++/6/bits/unordered_map.h:903:7: note: no known conversion for argument 1 from 'std::unordered_map<int, numere>::iterator {aka std::__detail::_Node_iterator<std::pair<const int, numere>, false, false>}' to 'const key_type& {aka const int&}' /usr/include/c++/6/bits/unordered_map.h:907:7: note: candidate: std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type& std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_type&&) [with _Key = int; _Tp = numere; _Hash = std::hash<int>; _Pred = std::equal_to<int>; _Alloc = std::allocator<std::pair<const int, numere> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type = numere; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_type = int] operator[](key_type&& __k) ^~~~~~~~ /usr/include/c++/6/bits/unordered_map.h:907:7: note: no known conversion for argument 1 from 'std::unordered_map<int, numere>::iterator {aka std::__detail::_Node_iterator<std::pair<const int, numere>, false, false>}' to 'std::unordered_map<int, numere>::key_type&& {aka int&&}' main.cpp:53:46: error: no match for 'operator[]' (operand types are 'std::unordered_map<int, numere>' and 'std::unordered_map<int, numere>::iterator {aka std::__detail::_Node_iterator<std::pair<const int, numere>, false, false>}') fout << hmap[S2].x << " " << hmap[S2].y << " " << hmap[S2].z; ^ In file included from /usr/include/c++/6/unordered_map:48:0, from main.cpp:4: /usr/include/c++/6/bits/unordered_map.h:903:7: note: candidate: std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type& std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](const key_type&) [with _Key = int; _Tp = numere; _Hash = std::hash<int>; _Pred = std::equal_to<int>; _Alloc = std::allocator<std::pair<const int, numere> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type = numere; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_type = int] operator[](const key_type& __k) ^~~~~~~~ /usr/include/c++/6/bits/unordered_map.h:903:7: note: no known conversion for argument 1 from 'std::unordered_map<int, numere>::iterator {aka std::__detail::_Node_iterator<std::pair<const int, numere>, false, false>}' to 'const key_type& {aka const int&}' /usr/include/c++/6/bits/unordered_map.h:907:7: note: candidate: std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type& std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_type&&) [with _Key = int; _Tp = numere; _Hash = std::hash<int>; _Pred = std::equal_to<int>; _Alloc = std::allocator<std::pair<const int, numere> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type = numere; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_type = int] operator[](key_type&& __k) ^~~~~~~~ /usr/include/c++/6/bits/unordered_map.h:907:7: note: no known conversion for argument 1 from 'std::unordered_map<int, numere>::iterator {aka std::__detail::_Node_iterator<std::pair<const int, numere>, false, false>}' to 'std::unordered_map<int, numere>::key_type&& {aka int&&}' main.cpp:53:67: error: no match for 'operator[]' (operand types are 'std::unordered_map<int, numere>' and 'std::unordered_map<int, numere>::iterator {aka std::__detail::_Node_iterator<std::pair<const int, numere>, false, false>}') fout << hmap[S2].x << " " << hmap[S2].y << " " << hmap[S2].z; Non zero exit status: 1

Ceva nu functioneaza?