#2741
SAO1
După ce ți-ai dat seama că nu poți învinge nici unul dintre monștrii (din problema SAO), ai decis să te retragi și să devii un fermier. Din banii pentru cumpărarea echipamentului ai cumpărat o parcelă codificată sub forma unei matrice de n
linii și m
coloane, pentru fiecare zonă cunoscându-se fertilitatea ei. Cum nu ai bani ca să cultivi pământul, dorești să selectezi o parcelă în care toate zonele să aibă aceeași fertilitate, iar fertilitatea totală să fie maximă. Fertilitatea totală a unei parcele este egală cu suma fertilităților zonelor care compun acea parcelă.
Dându-se matricea codificărilor zonelor din teren, să se determine fertilitatea totală maximă a unei parcele în care toate zonele au aceeași fertilitate.
Problema | SAO1 | Operații I/O |
sao1.in /sao1.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 10 MB
/
Stivă 10 MB
|
Id soluție | #49265837 | Utilizator | |
Fișier | sao1.cpp | Dimensiune | 2.75 KB |
Data încărcării | 22 Februarie 2024, 21:09 | Scor / rezultat | Eroare de compilare |
sao1.cpp:55:53: warning: 'nodiscard' attribute directive ignored [-Wattributes] [[nodiscard]] long long getOptimalTotal() const noexcept { return _homogenousTotal; } ^ sao1.cpp: In member function 'void FertilityMap::findMaxHomogeneousArea()': sao1.cpp:50:85: error: parameter declared 'auto' auto bestGroup = std::minmax_element(groups.begin(), groups.end(), [](auto &g1, auto &g2) {return g1.second.size() < g2.second.size();}); ^ sao1.cpp:50:95: error: parameter declared 'auto' auto bestGroup = std::minmax_element(groups.begin(), groups.end(), [](auto &g1, auto &g2) {return g1.second.size() < g2.second.size();}); ^ sao1.cpp: In lambda function: sao1.cpp:50:107: error: 'g1' was not declared in this scope auto bestGroup = std::minmax_element(groups.begin(), groups.end(), [](auto &g1, auto &g2) {return g1.second.size() < g2.second.size();}); ^ sao1.cpp:50:126: error: 'g2' was not declared in this scope auto bestGroup = std::minmax_element(groups.begin(), groups.end(), [](auto &g1, auto &g2) {return g1.second.size() < g2.second.size();}); ^ sao1.cpp: In member function 'void FertilityMap::findMaxHomogeneousArea()': sao1.cpp:51:36: error: base operand of '->' has non-pointer type 'std::pair<std::__detail::_Node_iterator<std::pair<const unsigned int, std::vector<Position> >, false, false>, std::__detail::_Node_iterator<std::pair<const unsigned int, std::vector<Position> >, false, false> >' _homogenousArea = bestGroup->first; ^ sao1.cpp:52:53: error: base operand of '->' has non-pointer type 'std::pair<std::__detail::_Node_iterator<std::pair<const unsigned int, std::vector<Position> >, false, false>, std::__detail::_Node_iterator<std::pair<const unsigned int, std::vector<Position> >, false, false> >' _homogenousTotal = std::accumulate(bestGroup->second.begin(), bestGroup->second.end(), static_cast<long long>(0)); ^ sao1.cpp:52:80: error: base operand of '->' has non-pointer type 'std::pair<std::__detail::_Node_iterator<std::pair<const unsigned int, std::vector<Position> >, false, false>, std::__detail::_Node_iterator<std::pair<const unsigned int, std::vector<Position> >, false, false> >' _homogenousTotal = std::accumulate(bestGroup->second.begin(), bestGroup->second.end(), static_cast<long long>(0)); ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from sao1.cpp:5: /usr/include/c++/4.8/bits/stl_algo.h: In instantiation of 'std::pair<_FIter, _FIter> std::minmax_element(_FIter, _FIter, _Compare) [with _FIter = std::__detail::_Node_iterator<std::pair<const unsigned int, std::vector<Position> >, false, false>; _Compare = FertilityMap::findMaxHomogeneousArea()::__lambda0]': sao1.cpp:50:144: required from here /usr/include/c++/4.8/bits/stl_algo.h:4170:35: error: no match for call to '(FertilityMap::findMaxHomogeneousArea()::__lambda0) (std::pair<const unsigned int, std::vector<Position> >&, std::pair<const unsigned int, std::vector<Position> >&)' if (__comp(*__next, *__first)) ^ sao1.cpp:50:77: note: candidates are: auto bestGroup = std::minmax_element(groups.begin(), groups.end(), [](auto &g1, auto &g2) {return g1.second.size() < g2.second.size();}); ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from sao1.cpp:5: /usr/include/c++/4.8/bits/stl_algo.h:4170:35: note: void (*)() <conversion> if (__comp(*__next, *__first)) ^ /usr/include/c++/4.8/bits/stl_algo.h:4170:35: note: candidate expects 1 argument, 3 provided sao1.cpp:50:97: note: FertilityMap::findMaxHomogeneousArea()::__lambda0 auto bestGroup = std::minmax_element(groups.begin(), groups.end(), [](auto &g1, auto &g2) {return g1.second.size() < g2.second.size();}); ^ sao1.cpp:50:97: note: candidate expects 0 arguments, 2 provided In file included from /usr/include/c++/4.8/algorithm:62:0, from sao1.cpp:5: /usr/include/c++/4.8/bits/stl_algo.h:4189:35: error: no match for call to '(FertilityMap::findMaxHomogeneousArea()::__lambda0) (std::pair<const unsigned int, std::vector<Position> >&, std::pair<const unsigned int, std::vector<Position> >&)' if (__comp(*__first, *__min)) ^ sao1.cpp:50:77: note: candidates are: auto bestGroup = std::minmax_element(groups.begin(), groups.end(), [](auto &g1, auto &g2) {return g1.second.size() < g2.second.size();}); ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from sao1.cpp:5: /usr/include/c++/4.8/bits/stl_algo.h:4189:35: note: void (*)() <conversion> if (__comp(*__first, *__min)) ^ /usr/include/c++/4.8/bits/stl_algo.h:4189:35: note: candidate expects 1 argument, 3 provided sao1.cpp:50:97: note: FertilityMap::findMaxHomogeneousArea()::__lambda0 auto bestGroup = std::minmax_element(groups.begin(), groups.end(), [](auto &g1, auto &g2) {return g1.second.size() < g2.second.size();}); ^ sao1.cpp:50:97: note: candidate expects 0 arguments, 2 provided In file included from /usr/include/c++/4.8/algorithm:62:0, from sao1.cpp:5: /usr/include/c++/4.8/bits/stl_algo.h:4191:41: error: no match for call to '(FertilityMap::findMaxHomogeneousArea()::__lambda0) (std::pair<const unsigned int, std::vector<Position> >&, std::pair<const unsigned int, std::vector<Position> >&)' else if (!__comp(*__first, *__max)) ^ sao1.cpp:50:77: note: candidates are: auto bestGroup = std::minmax_element(groups.begin(), groups.end(), [](auto &g1, auto &g2) {return g1.second.size() < g2.second.size();}); ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from sao1.cpp:5: /usr/include/c++/4.8/bits/stl_algo.h:4191:41: note: void (*)() <conversion> else if (!__comp(*__first, *__max)) ^ /usr/include/c++/4.8/bits/stl_algo.h:4191:41: note: candidate expects 1 argument, 3 provided sao1.cpp:50:97: note: FertilityMap::findMaxHomogeneousArea()::__lambda0 auto bestGroup = std::minmax_element(groups.begin(), groups.end(), [](auto &g1, auto &g2) {return g1.second.size() < g2.second.size();}); ^ sao1.cpp:50:97: note: candidate expects 0 arguments, 2 provided In file included from /usr/include/c++/4.8/algorithm:62:0, from sao1.cpp:5: /usr/include/c++/4.8/bits/stl_algo.h:4196:32: error: no match for call to '(FertilityMap::findMaxHomogeneousArea()::__lambda0) (std::pair<const unsigned int, std::vector<Position> >&, std::pair<const unsigned int, std::vector<Position> >&)' if (__comp(*__next, *__first)) ^ sao1.cpp:50:77: note: candidates are: auto bestGroup = std::minmax_element(groups.begin(), groups.end(), [](auto &g1, auto &g2) {return g1.second.size() < g2.second.size();}); ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from sao1.cpp:5: /usr/include/c++/4.8/bits/stl_algo.h:4196:32: note: void (*)() <conversion> if (__comp(*__next, *__first)) ^ /usr/include/c++/4.8/bits/stl_algo.h:4196:32: note: candidate expects 1 argument, 3 provided sao1.cpp:50:97: note: FertilityMap::findMaxHomogeneousArea()::__lambda0 auto bestGroup = std::minmax_element(groups.begin(), groups.end(), [](auto &g1, auto &g2) {return g1.second.size() < g2.second.size();}); ^ sao1.cpp:50:97: note: candidate expects 0 arguments, 2 provided In file included from /usr/include/c++/4.8/algorithm:62:0, from sao1.cpp:5: /usr/include/c++/4.8/bits/stl_algo.h:4198:34: error: no match for call to '(FertilityMap::findMaxHomogeneousArea()::__lambda0) (std::pair<const unsigned int, std::vector<Position> >&, std::pair<const unsigned int, std::vector<Position> >&)' if (__comp(*__next, *__min)) ^ sao1.cpp:50:77: note: candidates are: auto bestGroup = std::minmax_element(groups.begin(), groups.end(), [](auto &g1, auto &g2) {return g1.second.size() < g2.second.size();}); ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from sao1.cpp:5: /usr/include/c++/4.8/bits/stl_algo.h:4198:34: note: void (*)() <conversion> if (__comp(*__next, *__min)) ^ /usr/include/c++/4.8/bits/stl_algo.h:4198:34: note: candidate expects 1 argument, 3 provided sao1.cpp:50:97: note: FertilityMap::findMaxHomogeneousArea()::__lambda0 auto bestGroup = std::minmax_element(groups.begin(), groups.end(), [](auto &g1, auto &g2) {return g1.second.size() < g2.second.size();}); ^ sao1.cpp:50:97: note: candidate expects 0 arguments, 2 provided In file included from /usr/include/c++/4.8/algorithm:62:0, from sao1.cpp:5: /usr/include/c++/4.8/bits/stl_algo.h:4200:36: error: no match for call to '(FertilityMap::findMaxHomogeneousArea()::__lambda0) (std::pair<const unsigned int, std::vector<Position> >&, std::pair<const unsigned int, std::vector<Position> >&)' if (!__comp(*__first, *__max)) ^ sao1.cpp:50:77: note: candidates are: auto bestGroup = std::minmax_element(groups.begin(), groups.end(), [](auto &g1, auto &g2) {return g1.second.size() < g2.second.size();}); ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from sao1.cpp:5: /usr/include/c++/4.8/bits/stl_algo.h:4200:36: note: void (*)() <conversion> if (!__comp(*__first, *__max)) ^ /usr/include/c++/4.8/bits/stl_algo.h:4200:36: note: candidate expects 1 argument, 3 provided sao1.cpp:50:97: note: FertilityMap::findMaxHomogeneousArea()::__lambda0 auto bestGroup = std::minmax_element(groups.begin(), groups.end(), [](auto &g1, auto &g2) {return g1.second.size() < g2.second.size();}); ^ sao1.cpp:50:97: note: candidate expects 0 arguments, 2 provided In file included from /usr/include/c++/4.8/algorithm:62:0, from sao1.cpp:5: /usr/include/c++/4.8/bits/stl_algo.h:4205:35: error: no match for call to '(FertilityMap::findMaxHomogeneousArea()::__lambda0) (std::pair<const unsigned int, std::vector<Position> >&, std::pair<const unsigned int, std::vector<Position> >&)' if (__comp(*__first, *__min)) ^ sao1.cpp:50:77: note: candidates are: auto bestGroup = std::minmax_element(groups.begin(), groups.end(), [](auto &g1, auto &g2) {return g1.second.size() < g2.second.size();}); ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from sao1.cpp:5: /usr/include/c++/4.8/bits/stl_algo.h:4205:35: note: void (*)() <conversion> if (__comp(*__first, *__min)) ^ /usr/include/c++/4.8/bits/stl_algo.h:4205:35: note: candidate expects 1 argument, 3 provided sao1.cpp:50:97: note: FertilityMap::findMaxHomogeneousArea()::__lambda0 auto bestGroup = std::minmax_element(groups.begin(), groups.end(), [](auto &g1, auto &g2) {return g1.second.size() < g2.second.size();}); ^ sao1.cpp:50:97: note: candidate expects 0 arguments, 2 provided In file included from /usr/include/c++/4.8/algorithm:62:0, from sao1.cpp:5: /usr/include/c++/4.8/bits/stl_algo.h:4207:35: error: no match for call to '(FertilityMap::findMaxHomogeneousArea()::__lambda0) (std::pair<const unsigned int, std::vector<Position> >&, std::pair<const unsigned int, std::vector<Position> >&)' if (!__comp(*__next, *__max)) ^ sao1.cpp:50:77: note: candidates are: auto bestGroup = std::minmax_element(groups.begin(), groups.end(), [](auto &g1, auto &g2) {return g1.second.size() < g2.second.size();}); ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from sao1.cpp:5: /usr/include/c++/4.8/bits/stl_algo.h:4207:35: note: void (*)() <conversion> if (!__comp(*__next, *__max)) ^ /usr/include/c++/4.8/bits/stl_algo.h:4207:35: note: candidate expects 1 argument, 3 provided sao1.cpp:50:97: note: FertilityMap::findMaxHomogeneousArea()::__lambda0 auto bestGroup = std::minmax_element(groups.begin(), groups.end(), [](auto &g1, auto &g2) {return g1.second.size() < g2.second.size();}); ^ sao1.cpp:50:97: note: candidate expects 0 arguments, 2 provided In file included from /usr/include/c++/4.8/unordered_map:47:0, from sao1.cpp:3: /usr/include/c++/4.8/bits/hashtable.h: In instantiation of 'std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::_Hashtable(_InputIterator, _InputIterator, std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::size_type, const _H1&, const _H2&, const _Hash&, const _Equal&, const _ExtractKey&, const allocator_type&) [with _InputIterator = __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >; _Key = unsigned int; _Value = std::pair<const unsigned int, std::vector<Position> >; _Alloc = std::allocator<std::pair<const unsigned int, std::vector<Position> > >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<unsigned int>; _H1 = std::hash<unsigned int>; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<false, false, true>; std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::size_type = unsigned int; std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::allocator_type = std::allocator<std::pair<const unsigned int, std::vector<Position> > >]': /usr/include/c++/4.8/bits/hashtable.h:408:28: required from 'std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::_Hashtable(_InputIterator, _InputIterator, std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::size_type, const _H1&, const key_equal&, const allocator_type&) [with _InputIterator = __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >; _Key = unsigned int; _Value = std::pair<const unsigned int, std::vector<Position> >; _Alloc = std::allocator<std::pair<const unsigned int, std::vector<Position> > >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<unsigned int>; _H1 = std::hash<unsigned int>; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<false, false, true>; std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::size_type = unsigned int; std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::key_equal = std::equal_to<unsigned int>; std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::allocator_type = std::allocator<std::pair<const unsigned int, std::vector<Position> > >]' /usr/include/c++/4.8/bits/unordered_map.h:164:40: required from 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(_InputIterator, _InputIterator, std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type, const hasher&, const key_equal&, const allocator_type&) [with _InputIterator = __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >; _Key = unsigned int; _Tp = std::vector<Position>; _Hash = std::hash<unsigned int>; _Pred = std::equal_to<unsigned int>; _Alloc = std::allocator<std::pair<const unsigned int, std::vector<Position> > >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type = unsigned int; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::hasher = std::hash<unsigned int>; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_equal = std::equal_to<unsigned int>; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::allocator_type = std::allocator<std::pair<const unsigned int, std::vector<Position> > >]' sao1.cpp:49:54: required from here /usr/include/c++/4.8/bits/hashtable.h:864:8: error: no matching function for call to 'std::_Hashtable<unsigned int, std::pair<const unsigned int, std::vector<Position> >, std::allocator<std::pair<const unsigned int, std::vector<Position> > >, std::__detail::_Select1st, std::equal_to<unsigned int>, std::hash<unsigned int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::insert(long long int&)' this->insert(*__f); ^ /usr/include/c++/4.8/bits/hashtable.h:864:8: note: candidates are: In file included from /usr/include/c++/4.8/bits/hashtable.h:35:0, from /usr/include/c++/4.8/unordered_map:47, from sao1.cpp:3: /usr/include/c++/4.8/bits/hashtable_policy.h:766:2: note: template<class _Pair, class> std::__detail::_Insert<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits, false, _Unique_keys>::__ireturn_type std::__detail::_Insert<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits, false, _Unique_keys>::insert(_Pair&&) [with _Pair = _Pair; <template-parameter-2-2> = <template-parameter-1-2>; _Key = unsigned int; _Value = std::pair<const unsigned int, std::vector<Position> >; _Alloc = std::allocator<std::pair<const unsigned int, std::vector<Position> > >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<unsigned int>; _H1 = std::hash<unsigned int>; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<false, false, true>; bool _Unique_keys = true] insert(_Pair&& __v) ^ /usr/include/c++/4.8/bits/hashtable_policy.h:766:2: note: template argument deduction/substitution failed: /usr/include/c++/4.8/bits/hashtable_policy.h:774:2: note: template<class _Pair, class> std::__detail::_Insert<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits, false, _Unique_keys>::iterator std::__detail::_Insert<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits, false, _Unique_keys>::insert(std::__detail::_Insert<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits, false, _Unique_keys>::const_iterator, _Pair&&) [with _Pair = _Pair; <template-parameter-2-2> = <template-parameter-1-2>; _Key = unsigned int; _Value = std::pair<const unsigned int, std::vector<Position> >; _Alloc = std::allocator<std::pair<const unsigned int, std::vector<Position> > >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<unsigned int>; _H1 = std::hash<unsigned int>; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<false, false, true>; bool _Unique_keys = true] insert(const_iterator, _Pair&& __v) ^ /usr/include/c++/4.8/bits/hashtable_policy.h:774:2: note: template argument deduction/substitution failed: In file included from /usr/include/c++/4.8/unordered_map:47:0, from sao1.cpp:3: /usr/include/c++/4.8/bits/hashtable.h:864:8: note: cannot convert '__f.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator*<long long int*, std::vector<long long int> >()' (type 'long long int') to type 'std::__detail::_Insert<unsigned int, std::pair<const unsigned int, std::vector<Position> >, std::allocator<std::pair<const unsigned int, std::vector<Position> > >, std::__detail::_Select1st, std::equal_to<unsigned int>, std::hash<unsigned int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true>, false, true>::const_iterator {aka std::__detail::_Node_const_iterator<std::pair<const unsigned int, std::vector<Position> >, false, false>}' this->insert(*__f); ^ In file included from /usr/include/c++/4.8/bits/hashtable.h:35:0, from /usr/include/c++/4.8/unordered_map:47, from sao1.cpp:3: /usr/include/c++/4.8/bits/hashtable_policy.h:617:2: note: template<class _InputIterator> void std::__detail::_Insert_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::insert(_InputIterator, _InputIterator) [with _InputIterator = _InputIterator; _Key = unsigned int; _Value = std::pair<const unsigned int, std::vector<Position> >; _Alloc = std::allocator<std::pair<const unsigned int, std::vector<Position> > >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<unsigned int>; _H1 = std::hash<unsigned int>; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<false, false, true>] insert(_InputIterator __first, _InputIterator __last); ^ /usr/include/c++/4.8/bits/hashtable_policy.h:617:2: note: template argument deduction/substitution failed: In file included from /usr/include/c++/4.8/unordered_map:47:0, from sao1.cpp:3: /usr/include/c++/4.8/bits/hashtable.h:864:8: note: candidate expects 2 arguments, 1 provided this->insert(*__f); ^ In file included from /usr/include/c++/4.8/bits/hashtable.h:35:0, from /usr/include/c++/4.8/unordered_map:47, from sao1.cpp:3: /usr/include/c++/4.8/bits/hashtable_policy.h:612:7: note: void std::__detail::_Insert_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::insert(std::initializer_list<typename std::__detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2, _Hash, _Traits>::value_type>) [with _Key = unsigned int; _Value = std::pair<const unsigned int, std::vector<Position> >; _Alloc = std::allocator<std::pair<const unsigned int, std::vector<Position> > >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<unsigned int>; _H1 = std::hash<unsigned int>; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<false, false, true>; typename std::__detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2, _Hash, _Traits>::value_type = std::pair<const unsigned int, std::vector<Position> >] insert(initializer_list<value_type> __l) ^ /usr/include/c++/4.8/bits/hashtable_policy.h:612:7: note: no known conversion for argument 1 from 'long long int' to 'std::initializer_list<std::pair<const unsigned int, std::vector<Position> > >' /usr/include/c++/4.8/bits/hashtable_policy.h:608:7: note: std::__detail::_Insert_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::iterator std::__detail::_Insert_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::insert(std::__detail::_Insert_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::const_iterator, const value_type&) [with _Key = unsigned int; _Value = std::pair<const unsigned int, std::vector<Position> >; _Alloc = std::allocator<std::pair<const unsigned int, std::vector<Position> > >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<unsigned int>; _H1 = std::hash<unsigned int>; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<false, false, true>; std::__detail::_Insert_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::iterator = std::__detail::_Node_iterator<std::pair<const unsigned int, std::vector<Position> >, false, false>; std::__detail::_Insert_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::const_iterator = std::__detail::_Node_const_iterator<std::pair<const unsigned int, std::vector<Position> >, false, false>; std::__detail::_Insert_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::value_type = std::pair<const unsigned int, std::vector<Position> >] insert(const_iterator, const value_type& __v) ^ /usr/include/c++/4.8/bits/hashtable_policy.h:608:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/4.8/bits/hashtable_policy.h:601:7: note: std::__detail::_Insert_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::__ireturn_type std::__detail::_Insert_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::insert(const value_type&) [with _Key = unsigned int; _Value = std::pair<const unsigned int, std::vector<Position> >; _Alloc = std::allocator<std::pair<const unsigned int, std::vector<Position> > >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<unsigned int>; _H1 = std::hash<unsigned int>; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<false, false, true>; std::__detail::_Insert_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::__ireturn_type = std::pair<std::__detail::_Node_iterator<std::pair<const unsigned int, std::vector<Position> >, false, false>, bool>; std::__detail::_Insert_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::value_type = std::pair<const unsigned int, std::vector<Position> >] insert(const value_type& __v) ^ /usr/include/c++/4.8/bits/hashtable_policy.h:601:7: note: no known conversion for argument 1 from 'long long int' to 'const value_type& {aka const std::pair<const unsigned int, std::vector<Position> >&}'
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SAO1 face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.