fork(1) download
  1. #include <iostream>
  2. #include <queue>
  3. #include <unordered_map>
  4. #include <algorithm>
  5.  
  6. void init_container(std::unordered_map<std::size_t, std::size_t> *container, const std::size_t m){
  7. std::size_t weight;
  8. for(std::size_t i = 0; i < m; i++){
  9. std::cin >> weight;
  10. container->insert(i, weight);
  11. }
  12. }
  13.  
  14. int main(){
  15. std::size_t n, m, a, b, k;
  16. std::priority_queue<int> warehouse;
  17. std::unordered_map<std::size_t, std::size_t> container;
  18. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
In file included from /usr/include/c++/5/bits/hashtable.h:35:0,
                 from /usr/include/c++/5/unordered_map:47,
                 from prog.cpp:3:
/usr/include/c++/5/bits/hashtable_policy.h: In instantiation of 'void std::__detail::_Insert_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::_M_insert_range(_InputIterator, _InputIterator, const _NodeGetter&) [with _InputIterator = unsigned int; _NodeGetter = std::__detail::_AllocNode<std::allocator<std::__detail::_Hash_node<std::pair<const unsigned int, unsigned int>, false> > >; _Key = unsigned int; _Value = std::pair<const unsigned int, unsigned int>; _Alloc = std::allocator<std::pair<const unsigned int, unsigned int> >; _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>]':
/usr/include/c++/5/bits/hashtable_policy.h:736:26:   required from 'void std::__detail::_Insert_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::insert(_InputIterator, _InputIterator) [with _InputIterator = unsigned int; _Key = unsigned int; _Value = std::pair<const unsigned int, unsigned int>; _Alloc = std::allocator<std::pair<const unsigned int, unsigned int> >; _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>]'
/usr/include/c++/5/bits/unordered_map.h:489:4:   required from 'void std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator, _InputIterator) [with _InputIterator = unsigned int; _Key = unsigned int; _Tp = unsigned int; _Hash = std::hash<unsigned int>; _Pred = std::equal_to<unsigned int>; _Alloc = std::allocator<std::pair<const unsigned int, unsigned int> >]'
prog.cpp:10:30:   required from here
/usr/include/c++/5/bits/hashtable_policy.h:755:45: error: no matching function for call to '__distance_fw(unsigned int&, unsigned int&)'
  size_type __n_elt = __detail::__distance_fw(__first, __last);
                                             ^
/usr/include/c++/5/bits/hashtable_policy.h:64:5: note: candidate: template<class _Iterator> typename std::iterator_traits<_Iterator>::difference_type std::__detail::__distance_fw(_Iterator, _Iterator, std::input_iterator_tag)
     __distance_fw(_Iterator __first, _Iterator __last,
     ^
/usr/include/c++/5/bits/hashtable_policy.h:64:5: note:   template argument deduction/substitution failed:
/usr/include/c++/5/bits/hashtable_policy.h:755:45: note:   candidate expects 3 arguments, 2 provided
  size_type __n_elt = __detail::__distance_fw(__first, __last);
                                             ^
/usr/include/c++/5/bits/hashtable_policy.h:70:5: note: candidate: template<class _Iterator> typename std::iterator_traits<_Iterator>::difference_type std::__detail::__distance_fw(_Iterator, _Iterator, std::forward_iterator_tag)
     __distance_fw(_Iterator __first, _Iterator __last,
     ^
/usr/include/c++/5/bits/hashtable_policy.h:70:5: note:   template argument deduction/substitution failed:
/usr/include/c++/5/bits/hashtable_policy.h:755:45: note:   candidate expects 3 arguments, 2 provided
  size_type __n_elt = __detail::__distance_fw(__first, __last);
                                             ^
/usr/include/c++/5/bits/hashtable_policy.h:76:5: note: candidate: template<class _Iterator> typename std::iterator_traits<_Iterator>::difference_type std::__detail::__distance_fw(_Iterator, _Iterator)
     __distance_fw(_Iterator __first, _Iterator __last)
     ^
/usr/include/c++/5/bits/hashtable_policy.h:76:5: note:   template argument deduction/substitution failed:
/usr/include/c++/5/bits/hashtable_policy.h: In substitution of 'template<class _Iterator> typename std::iterator_traits<_Iterator>::difference_type std::__detail::__distance_fw(_Iterator, _Iterator) [with _Iterator = unsigned int]':
/usr/include/c++/5/bits/hashtable_policy.h:755:45:   required from 'void std::__detail::_Insert_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::_M_insert_range(_InputIterator, _InputIterator, const _NodeGetter&) [with _InputIterator = unsigned int; _NodeGetter = std::__detail::_AllocNode<std::allocator<std::__detail::_Hash_node<std::pair<const unsigned int, unsigned int>, false> > >; _Key = unsigned int; _Value = std::pair<const unsigned int, unsigned int>; _Alloc = std::allocator<std::pair<const unsigned int, unsigned int> >; _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>]'
/usr/include/c++/5/bits/hashtable_policy.h:736:26:   required from 'void std::__detail::_Insert_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::insert(_InputIterator, _InputIterator) [with _InputIterator = unsigned int; _Key = unsigned int; _Value = std::pair<const unsigned int, unsigned int>; _Alloc = std::allocator<std::pair<const unsigned int, unsigned int> >; _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>]'
/usr/include/c++/5/bits/unordered_map.h:489:4:   required from 'void std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator, _InputIterator) [with _InputIterator = unsigned int; _Key = unsigned int; _Tp = unsigned int; _Hash = std::hash<unsigned int>; _Pred = std::equal_to<unsigned int>; _Alloc = std::allocator<std::pair<const unsigned int, unsigned int> >]'
prog.cpp:10:30:   required from here
/usr/include/c++/5/bits/hashtable_policy.h:76:5: error: no type named 'difference_type' in 'struct std::iterator_traits<unsigned int>'
/usr/include/c++/5/bits/hashtable_policy.h: In instantiation of 'void std::__detail::_Insert_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::_M_insert_range(_InputIterator, _InputIterator, const _NodeGetter&) [with _InputIterator = unsigned int; _NodeGetter = std::__detail::_AllocNode<std::allocator<std::__detail::_Hash_node<std::pair<const unsigned int, unsigned int>, false> > >; _Key = unsigned int; _Value = std::pair<const unsigned int, unsigned int>; _Alloc = std::allocator<std::pair<const unsigned int, unsigned int> >; _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>]':
/usr/include/c++/5/bits/hashtable_policy.h:736:26:   required from 'void std::__detail::_Insert_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::insert(_InputIterator, _InputIterator) [with _InputIterator = unsigned int; _Key = unsigned int; _Value = std::pair<const unsigned int, unsigned int>; _Alloc = std::allocator<std::pair<const unsigned int, unsigned int> >; _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>]'
/usr/include/c++/5/bits/unordered_map.h:489:4:   required from 'void std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator, _InputIterator) [with _InputIterator = unsigned int; _Key = unsigned int; _Tp = unsigned int; _Hash = std::hash<unsigned int>; _Pred = std::equal_to<unsigned int>; _Alloc = std::allocator<std::pair<const unsigned int, unsigned int> >]'
prog.cpp:10:30:   required from here
/usr/include/c++/5/bits/hashtable_policy.h:768:18: error: invalid type argument of unary '*' (have 'unsigned int')
    __h._M_insert(*__first, __node_gen, __unique_keys());
                  ^
stdout
Standard output is empty