#include <iostream>
#include <queue>
#include <unordered_map>
#include <algorithm>
void init_container(std::unordered_map<std::size_t, std::size_t> *container, const std::size_t m){
std::size_t weight;
for(std::size_t i = 0; i < m; i++){
std::cin >> weight;
container->insert(i, weight);
}
}
int main(){
std::size_t n, m, a, b, k;
std::priority_queue<int> warehouse;
std::unordered_map<std::size_t, std::size_t> container;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8cXVldWU+CiNpbmNsdWRlIDx1bm9yZGVyZWRfbWFwPgojaW5jbHVkZSA8YWxnb3JpdGhtPgoKdm9pZCBpbml0X2NvbnRhaW5lcihzdGQ6OnVub3JkZXJlZF9tYXA8c3RkOjpzaXplX3QsIHN0ZDo6c2l6ZV90PiAqY29udGFpbmVyLCBjb25zdCBzdGQ6OnNpemVfdCBtKXsKCXN0ZDo6c2l6ZV90IHdlaWdodDsKCWZvcihzdGQ6OnNpemVfdCBpID0gMDsgaSA8IG07IGkrKyl7CgkJc3RkOjpjaW4gPj4gd2VpZ2h0OwoJCWNvbnRhaW5lci0+aW5zZXJ0KGksIHdlaWdodCk7Cgl9Cn0KCmludCBtYWluKCl7CglzdGQ6OnNpemVfdCBuLCBtLCBhLCBiLCBrOwoJc3RkOjpwcmlvcml0eV9xdWV1ZTxpbnQ+IHdhcmVob3VzZTsKCXN0ZDo6dW5vcmRlcmVkX21hcDxzdGQ6OnNpemVfdCwgc3RkOjpzaXplX3Q+IGNvbnRhaW5lcjsKfQ==
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());
^