Detalii evaluare #58986453

Rezumat problemă

Să se calculeze suma a două matrice rare .

Detalii

Problema Matrice_Rara Operații I/O matrice_rara.in/matrice_rara.out
Limita timp 1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #58986453 Utilizator Baracci Alexandru (aalex07)
Fișier matrice_rara.cpp Dimensiune 1.07 KB
Data încărcării 11 Septembrie 2025, 20:30 Scor/rezultat Eroare de compilare

Evaluare

Mesaj compilare

matrice_rara.cpp: In member function 'size_t custom_hash::operator()(uint64_t) const':
matrice_rara.cpp:16:46: error: 'chrono' has not been declared
         static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();

                                              ^
In file included from /usr/include/c++/4.8/bits/hashtable.h:35:0,
                 from /usr/include/c++/4.8/unordered_map:47,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:115,
                 from matrice_rara.cpp:1:
/usr/include/c++/4.8/bits/hashtable_policy.h: In instantiation of 'struct std::__detail::__is_noexcept_hash<std::pair<int, int>, custom_hash>':
/usr/include/c++/4.8/type_traits:121:12:   recursively required from 'struct std::__and_<std::is_default_constructible<custom_hash>, std::is_copy_assignable<custom_hash>, std::__detail::__is_noexcept_hash<std::pair<int, int>, custom_hash> >'
/usr/include/c++/4.8/type_traits:121:12:   required from 'struct std::__and_<std::__is_fast_hash<custom_hash>, std::is_default_constructible<custom_hash>, std::is_copy_assignable<custom_hash>, std::__detail::__is_noexcept_hash<std::pair<int, int>, custom_hash> >'
/usr/include/c++/4.8/type_traits:127:38:   required from 'struct std::__not_<std::__and_<std::__is_fast_hash<custom_hash>, std::is_default_constructible<custom_hash>, std::is_copy_assignable<custom_hash>, std::__detail::__is_noexcept_hash<std::pair<int, int>, custom_hash> > >'
/usr/include/c++/4.8/bits/unordered_map.h:99:66:   required from 'class std::unordered_map<std::pair<int, int>, long long int, custom_hash>'
matrice_rara.cpp:22:65:   required from here
/usr/include/c++/4.8/bits/hashtable_policy.h:85:33: error: no match for call to '(const custom_hash) (const std::pair<int, int>&)'
  noexcept(declval<const _Hash&>()(declval<const _Key&>()))>
                                 ^
matrice_rara.cpp:6:8: note: candidate is:
 struct custom_hash {

        ^
matrice_rara.cpp:15:12: note: size_t custom_hash::operator()(uint64_t) const
     size_t operator()(uint64_t x) const {

            ^
matrice_rara.cpp:15:12: note:   no known conversion for argument 1 from 'const std::pair<int, int>' to 'uint64_t {aka long long unsigned int}'
In file included from /usr/include/c++/4.8/bits/move.h:57:0,
                 from /usr/include/c++/4.8/bits/stl_pair.h:59,
                 from /usr/include/c++/4.8/bits/stl_algobase.h:64,
                 from /usr/include/c++/4.8/bits/char_traits.h:39,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from matrice_rara.cpp:1:
/usr/include/c++/4.8/type_traits: In instantiation of 'struct std::__not_<std::__and_<std::__is_fast_hash<custom_hash>, std::is_default_constructible<custom_hash>, std::is_copy_assignable<custom_hash>, std::__detail::__is_noexcept_hash<std::pair<int, int>, custom_hash> > >':
/usr/include/c++/4.8/bits/unordered_map.h:99:66:   required from 'class std::unordered_map<std::pair<int, int>, long long int, custom_hash>'
matrice_rara.cpp:22:65:   required from here
/usr/include/c++/4.8/type_traits:127:38: error: 'value' is not a member of 'std::__and_<std::__is_fast_hash<custom_hash>, std::is_default_constructible<custom_hash>, std::is_copy_assignable<custom_hash>, std::__detail::__is_noexcept_hash<std::pair<int, int>, custom_hash> >'
     : public integral_constant<bool, !_Pp::value>
                                      ^
In file included from /usr/include/c++/4.8/unordered_map:48:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:115,
                 from matrice_rara.cpp:1:
/usr/include/c++/4.8/bits/unordered_map.h: In instantiation of 'class std::unordered_map<std::pair<int, int>, long long int, custom_hash>':
matrice_rara.cpp:22:65:   required from here
/usr/include/c++/4.8/bits/unordered_map.h:99:66: error: 'value' is not a member of 'std::__not_<std::__and_<std::__is_fast_hash<custom_hash>, std::is_default_constructible<custom_hash>, std::is_copy_assignable<custom_hash>, std::__detail::__is_noexcept_hash<std::pair<int, int>, custom_hash> > >'
       typedef __umap_hashtable<_Key, _Tp, _Hash, _Pred, _Alloc>  _Hashtable;
                                                                  ^
/usr/include/c++/4.8/bits/unordered_map.h:106:45: error: 'value' is not a member of 'std::__not_<std::__and_<std::__is_fast_hash<custom_hash>, std::is_default_constructible<custom_hash>, std::is_copy_assignable<custom_hash>, std::__detail::__is_noexcept_hash<std::pair<int, int>, custom_hash> > >'
       typedef typename _Hashtable::key_type key_type;
                                             ^
/usr/include/c++/4.8/bits/unordered_map.h:107:47: error: 'value' is not a member of 'std::__not_<std::__and_<std::__is_fast_hash<custom_hash>, std::is_default_constructible<custom_hash>, std::is_copy_assignable<custom_hash>, std::__detail::__is_noexcept_hash<std::pair<int, int>, custom_hash> > >'
       typedef typename _Hashtable::value_type value_type;
                                               ^
/usr/include/c++/4.8/bits/unordered_map.h:108:48: error: 'value' is not a member of 'std::__not_<std::__and_<std::__is_fast_hash<custom_hash>, std::is_default_constructible<custom_hash>, std::is_copy_assignable<custom_hash>, std::__detail::__is_noexcept_hash<std::pair<int, int>, custom_hash> > >'
       typedef typename _Hashtable::mapped_type mapped_type;
                                                ^
/usr/include/c++/4.8/bits/unordered_map.h:109:43: error: 'value' is not a member of 'std::__not_<std::__and_<std::__is_fast_hash<custom_hash>, std::is_default_constructible<custom_hash>, std::is_copy_assignable<custom_hash>, std::__detail::__is_noexcept_hash<std::pair<int, int>, custom_hash> > >'
       typedef typename _Hashtable::hasher hasher;
                                           ^
/usr/include/c++/4.8/bits/unordered_map.h:110:46: error: 'value' is not a member of 'std::__not_<std::__and_<std::__is_fast_hash<custom_hash>, std::is_default_constructible<custom_hash>, std::is_copy_assignable<custom_hash>, std::__detail::__is_noexcept_hash<std::pair<int, int>, custom_hash> > >'
       typedef typename _Hashtable::key_equal key_equal;
                                              ^
/usr/include/c++/4.8/bits/unordered_map.h:111:51: error: 'value' is not a member of 'std::__not_<std::__and_<std::__is_fast_hash<custom_hash>, std::is_default_constructible<custom_hash>, std::is_copy_assignable<custom_hash>, std::__detail::__is_noexcept_hash<std::pair<int, int>, custom_hash> > >'
       typedef typename _Hashtable::allocator_type allocator_type;
                                                   ^
/usr/include/c++/4.8/bits/unordered_map.h:120:46: error: 'value' is not a member of 'std::__not_<std::__and_<std::__is_fast_hash<custom_hash>, std::is_default_constructible<custom_hash>, std::is_copy_assignable<custom_hash>, std::__detail::__is_noexcept_hash<std::pair<int, int>, custom_hash> > >'
       typedef typename _Hashtable::iterator  iterator;
                                              ^
/usr/include/c++/4.8/bits/unordered_map.h:121:51: error: 'value' is not a member of 'std::__not_<std::__and_<std::__is_fast_hash<custom_hash>, std::is_default_constructible<custom_hash>, std::is_copy_assignable<custom_hash>, std::__detail::__is_noexcept_hash<std::pair<int, int>, custom_hash> > >'
       typedef typename _Hashtable::const_iterator const_iterator;
                                                   ^
/usr/include/c++/4.8/bits/unordered_map.h:122:51: error: 'value' is not a member of 'std::__not_<std::__and_<std::__is_fast_hash<custom_hash>, std::is_default_constructible<custom_hash>, std::is_copy_assignable<custom_hash>, std::__detail::__is_noexcept_hash<std::pair<int, int>, custom_hash> > >'
       typedef typename _Hashtable::local_iterator local_iterator;
                                                   ^
/usr/include/c++/4.8/bits/unordered_map.h:123:57: error: 'value' is not a member of 'std::__not_<std::__and_<std::__is_fast_hash<custom_hash>, std::is_default_constructible<custom_hash>, std::is_copy_assignable<custom_hash>, std::__detail::__is_noexcept_hash<std::pair<int, int>, custom_hash> > >'
       typedef typename _Hashtable::const_local_iterator const_local_iterator;
                                                         ^
/usr/include/c++/4.8/bits/unordered_map.h:124:47: error: 'value' is not a member of 'std::__not_<std::__and_<std::__is_fast_hash<custom_hash>, std::is_default_constructible<custom_hash>, std::is_copy_assignable<custom_hash>, std::__detail::__is_noexcept_hash<std::pair<int, int>, custom_hash> > >'
       typedef typename _Hashtable::size_type  size_type;
                                               ^
/usr/include/c++/4.8/bits/unordered_map.h:125:52: error: 'value' is not a member of 'std::__not_<std::__and_<std::__is_fast_hash<custom_hash>, std::is_default_constructible<custom_hash>, std::is_copy_assignable<custom_hash>, std::__detail::__is_noexcept_hash<std::pair<int, int>, custom_hash> > >'
       typedef typename _Hashtable::difference_type difference_type;
                                                    ^
/usr/include/c++/4.8/bits/unordered_map.h:212:7: error: 'value' is not a member of 'std::__not_<std::__and_<std::__is_fast_hash<custom_hash>, std::is_default_constructible<custom_hash>, std::is_copy_assignable<custom_hash>, std::__detail::__is_noexcept_hash<std::pair<int, int>, custom_hash> > >'
       operator=(initializer_list<value_type> __l)
       ^
/usr/include/c++/4.8/bits/unordered_map.h:310:2: error: 'value' is not a member of 'std::__not_<std::__and_<std::__is_fast_hash<custom_hash>, std::is_default_constructible<custom_hash>, std::is_copy_assignable<custom_hash>, std::__detail::__is_noexcept_hash<std::pair<int, int>, custom_hash> > >'
  emplace(_Args&&... __args)
  ^
/usr/include/c++/4.8/bits/unordered_map.h:362:7: error: 'value' is not a member of 'std::__not_<std::__and_<std::__is_fast_hash<custom_hash>, std::is_default_constructible<custom_hash>, std::is_copy_assignable<custom_hash>, std::__detail::__is_noexcept_hash<std::pair<int, int>, custom_hash> > >'
       insert(const value_type& __x)
       ^
/usr/include/c++/4.8/bits/unordered_map.h:369:2: error: 'value' is not a member of 'std::__not_<std::__and_<std::__is_fast_hash<custom_hash>, std::is_default_constructible<custom_hash>, std::is_copy_assignable<custom_hash>, std::__detail::__is_noexcept_hash<std::pair<int, int>, custom_hash> > >'
  insert(_Pair&& __x)
  ^
/usr/include/c++/4.8/bits/unordered_map.h:429:7: error: 'value' is not a member of 'std::__not_<std::__and_<std::__is_fast_hash<custom_hash>, std::is_default_constructible<custom_hash>, std::is_copy_assignable<custom_hash>, std::__detail::__is_noexcept_hash<std::pair<int, int>, custom_hash> > >'
       insert(initializer_list<value_type> __l)
       ^
/usr/include/c++/4.8/bits/unordered_map.h:573:7: error: 'value' is not a member of 'std::__not_<std::__and_<std::__is_fast_hash<custom_hash>, std::is_default_constructible<custom_hash>, std::is_copy_assignable<custom_hash>, std::__detail::__is_noexcept_hash<std::pair<int, int>, custom_hash> > >'
       equal_range(const key_type& __x)
       ^
/usr/include/c++/4.8/bits/unordered_map.h:577:7: error: 'value' is not a member of 'std::__not_<std::__and_<std::__is_fast_hash<custom_hash>, std::is_default_constructible<custom_hash>, std::is_copy_assignable<custom_hash>, std::__detail::__is_noexcept_hash<std::pair<int, int>, custom_hash> > >'
       equal_range(const key_type& __x) const
       ^
matrice_rara.cpp: At global scope:
matrice_rara.cpp:22:65: error: no matching function for call to 'std::unordered_map<std::pair<int, int>, long long int, custom_hash>::unordered_map()'
 std::unordered_map<std::pair<int, int>, long long, custom_hash> mp;

                                                                 ^
matrice_rara.cpp:22:65: note: candidates are:
In file included from /usr/include/c++/4.8/unordered_map:48:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:115,
                 from matrice_rara.cpp:1:
/usr/include/c++/4.8/bits/unordered_map.h:171:7: note: std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&&) [with _Key = std::pair<int, int>; _Tp = long long int; _Hash = custom_hash; _Pred = std::equal_to<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, long long int> >]
       unordered_map(unordered_map&&) = default;
       ^
/usr/include/c++/4.8/bits/unordered_map.h:171:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/4.8/bits/unordered_map.h:168:7: note: std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(const std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&) [with _Key = std::pair<int, int>; _Tp = long long int; _Hash = custom_hash; _Pred = std::equal_to<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, long long int> >]
       unordered_map(const unordered_map&) = default;
       ^
/usr/include/c++/4.8/bits/unordered_map.h:168:7: note:   candidate expects 1 argument, 0 provided
matrice_rara.cpp: In function 'int main()':
matrice_rara.cpp:33:11: error: no match for 'operator[]' (operand types are 'std::unordered_map<std::pair<int, int>, long long int, custom_hash>' and '<brace-enclosed initializer list>')
         mp[{x, y}] += val;

           ^
matrice_rara.cpp:36:16: error: 'class std::unordered_map<std::pair<int, int>, long long int, custom_hash>' has no member named 'size'
     fout << mp.size() << '\n';

                ^
matrice_rara.cpp:37:18: error: no matching function for call to 'begin(std::unordered_map<std::pair<int, int>, long long int, custom_hash>&)'
     for(auto k : mp)

                  ^
matrice_rara.cpp:37:18: note: candidates are:
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94:0,
                 from matrice_rara.cpp:1:
/usr/include/c++/4.8/valarray:1206:5: note: template<class _Tp> const _Tp* std::begin(const std::valarray<_Tp>&)
     begin(const valarray<_Tp>& __va)
     ^
/usr/include/c++/4.8/valarray:1206:5: note:   template argument deduction/substitution failed:
matrice_rara.cpp:37:18: note:   'std::unordered_map<std::pair<int, int>, long long int, custom_hash>' is not derived from 'const std::valarray<_Tp>'
     for(auto k : mp)

                  ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94:0,
                 from matrice_rara.cpp:1:
/usr/include/c++/4.8/valarray:1196:5: note: template<class _Tp> _Tp* std::begin(std::valarray<_Tp>&)
     begin(valarray<_Tp>& __va)
     ^
/usr/include/c++/4.8/valarray:1196:5: note:   template argument deduction/substitution failed:
matrice_rara.cpp:37:18: note:   'std::unordered_map<std::pair<int, int>, long long int, custom_hash>' is not derived from 'std::valarray<_Tp>'
     for(auto k : mp)

                  ^
In file included from /usr/include/c++/4.8/bits/basic_string.h:42:0,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from matrice_rara.cpp:1:
/usr/include/c++/4.8/initializer_list:89:5: note: template<class _Tp> constexpr const _Tp* std::begin(std::initializer_list<_Tp>)
     begin(initializer_list<_Tp> __ils) noexcept
     ^
/usr/include/c++/4.8/initializer_list:89:5: note:   template argument deduction/substitution failed:
matrice_rara.cpp:37:18: note:   'std::unordered_map<std::pair<int, int>, long long int, custom_hash>' is not derived from 'std::initializer_list<_Tp>'
     for(auto k : mp)

                  ^
In file included from /usr/include/c++/4.8/string:51:0,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from matrice_rara.cpp:1:
/usr/include/c++/4.8/bits/range_access.h:87:5: note: template<class _Tp, unsigned int _Nm> _Tp* std::begin(_Tp (&)[_Nm])
     begin(_Tp (&__arr)[_Nm])
     ^
/usr/include/c++/4.8/bits/range_access.h:87:5: note:   template argument deduction/substitution failed:
matrice_rara.cpp:37:18: note:   mismatched types '_Tp [_Nm]' and 'std::unordered_map<std::pair<int, int>, long long int, custom_hash>'
     for(auto k : mp)

                  ^
In file included from /usr/include/c++/4.8/string:51:0,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from matrice_rara.cpp:1:
/usr/include/c++/4.8/bits/range_access.h:58:5: note: template<class _Container> decltype (__cont.begin()) std::begin(const _Container&)
     begin(const _Container& __cont) -> decltype(__cont.begin())
     ^
/usr/include/c++/4.8/bits/range_access.h:58:5: note:   template argument deduction/substitution failed:
/usr/include/c++/4.8/bits/range_access.h: In substitution of 'template<class _Container> decltype (__cont.begin()) std::begin(const _Container&) [with _Container = std::unordered_map<std::pair<int, int>, long long int, custom_hash>]':
matrice_rara.cpp:37:18:   required from here
/usr/include/c++/4.8/bits/range_access.h:58:5: error: 'const class std::unordered_map<std::pair<int, int>, long long int, custom_hash>' has no member named 'begin'
/usr/include/c++/4.8/bits/range_access.h:48:5: note: template<class _Container> decltype (__cont.begin()) std::begin(_Container&)
     begin(_Container& __cont) -> decltype(__cont.begin())
     ^
/usr/include/c++/4.8/bits/range_access.h:48:5: note:   template argument deduction/substitution failed:
/usr/include/c++/4.8/bits/range_access.h: In substitution of 'template<class _Container> decltype (__cont.begin()) std::begin(_Container&) [with _Container = std::unordered_map<std::pair<int, int>, long long int, custom_hash>]':
matrice_rara.cpp:37:18:   required from here
/usr/include/c++/4.8/bits/range_access.h:48:5: error: 'class std::unordered_map<std::pair<int, int>, long long int, custom_hash>' has no member named 'begin'
matrice_rara.cpp:37:18: error: no matching function for call to 'end(std::unordered_map<std::pair<int, int>, long long int, custom_hash>&)'
     for(auto k : mp)

                  ^
matrice_rara.cpp:37:18: note: candidates are:
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94:0,
                 from matrice_rara.cpp:1:
/usr/include/c++/4.8/valarray:1226:5: note: template<class _Tp> const _Tp* std::end(const std::valarray<_Tp>&)
     end(const valarray<_Tp>& __va)
     ^
/usr/include/c++/4.8/valarray:1226:5: note:   template argument deduction/substitution failed:
matrice_rara.cpp:37:18: note:   'std::unordered_map<std::pair<int, int>, long long int, custom_hash>' is not derived from 'const std::valarray<_Tp>'
     for(auto k : mp)

                  ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94:0,
                 from matrice_rara.cpp:1:
/usr/include/c++/4.8/valarray:1216:5: note: template<class _Tp> _Tp* std::end(std::valarray<_Tp>&)
     end(valarray<_Tp>& __va)
     ^
/usr/include/c++/4.8/valarray:1216:5: note:   template argument deduction/substitution failed:
matrice_rara.cpp:37:18: note:   'std::unordered_map<std::pair<int, int>, long long int, custom_hash>' is not derived from 'std::valarray<_Tp>'
     for(auto k : mp)

                  ^
In file included from /usr/include/c++/4.8/bits/basic_string.h:42:0,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from matrice_rara.cpp:1:
/usr/include/c++/4.8/initializer_list:99:5: note: template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)
     end(initializer_list<_Tp> __ils) noexcept
     ^
/usr/include/c++/4.8/initializer_list:99:5: note:   template argument deduction/substitution failed:
matrice_rara.cpp:37:18: note:   'std::unordered_map<std::pair<int, int>, long long int, custom_hash>' is not derived from 'std::initializer_list<_Tp>'
     for(auto k : mp)

                  ^
In file included from /usr/include/c++/4.8/string:51:0,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from matrice_rara.cpp:1:
/usr/include/c++/4.8/bits/range_access.h:97:5: note: template<class _Tp, unsigned int _Nm> _Tp* std::end(_Tp (&)[_Nm])
     end(_Tp (&__arr)[_Nm])
     ^
/usr/include/c++/4.8/bits/range_access.h:97:5: note:   template argument deduction/substitution failed:
matrice_rara.cpp:37:18: note:   mismatched types '_Tp [_Nm]' and 'std::unordered_map<std::pair<int, int>, long long int, custom_hash>'
     for(auto k : mp)

                  ^
In file included from /usr/include/c++/4.8/string:51:0,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from matrice_rara.cpp:1:
/usr/include/c++/4.8/bits/range_access.h:78:5: note: template<class _Container> decltype (__cont.end()) std::end(const _Container&)
     end(const _Container& __cont) -> decltype(__cont.end())
     ^
/usr/include/c++/4.8/bits/range_access.h:78:5: note:   template argument deduction/substitution failed:
/usr/include/c++/4.8/bits/range_access.h: In substitution of 'template<class _Container> decltype (__cont.end()) std::end(const _Container&) [with _Container = std::unordered_map<std::pair<int, int>, long long int, custom_hash>]':
matrice_rara.cpp:37:18:   required from here
/usr/include/c++/4.8/bits/range_access.h:78:5: error: 'const class std::unordered_map<std::pair<int, int>, long long int, custom_hash>' has no member named 'end'
/usr/include/c++/4.8/bits/range_access.h:68:5: note: template<class _Container> decltype (__cont.end()) std::end(_Container&)
     end(_Container& __cont) -> decltype(__cont.end())
     ^
/usr/include/c++/4.8/bits/range_access.h:68:5: note:   template argument deduction/substitution failed:
/usr/include/c++/4.8/bits/range_access.h: In substitution of 'template<class _Container> decltype (__cont.end()) std::end(_Container&) [with _Container = std::unordered_map<std::pair<int, int>, long long int, custom_hash>]':
matrice_rara.cpp:37:18:   required from here
/usr/include/c++/4.8/bits/range_access.h:68:5: error: 'class std::unordered_map<std::pair<int, int>, long long int, custom_hash>' has no member named 'end'

Cum funcționează evaluarea?

www.pbinfo.ro permite evaluarea a două tipuri de probleme:

  • probleme la care rezolvarea presupune scrierea unui program complet
  • probleme la care rezolvarea presupune scrierea unei secvențe de program - câteva instrucțiuni, o listă de declarații, una sau mai multe funcții, etc.

Problema Matrice_Rara face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:

  • Programul sursă este compilat folosind compilatorul corespunzător. Dacă în urma compilării se obțin erori sau avertismente, acestea sunt afișate în această pagină.
  • Dacă programul a fost compilat, executabilul obținut va fi rulat, furnizându-i-se unul sau mai multe seturi de date de intrare, în concordanță cu restricțiile specifice problemei. Pentru fiecare set de date se obține un anumit punctaj, în raport cu corectitudinea soluției tale.

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ă.

Du-te sus!