Detalii evaluare #51494609

Rezumat problemă

#1980 bona

În camera copiilor problema spațiului este esențială. De aceea locul unde sunt depozitate jucăriile este asemănător unei matrici pătratice, dispuse vertical, fiecare jucărie ocupând un locație bine stabilită.

Entuziasmul și bucuria copiilor în a se juca este bine cunoscută, dar și ”disponibilitatea” acestora de a ordona (reașeza) jucăriile la locul prestabilit este proverbială. Cum, după o rundă de joacă, întotdeauna urmează un episod din serialul de desene animate preferat, copii așează la întâmplare jucăriile.

Cunoscând numărul M de jucării, iar pentru fiecare jucărie locația în care copii au pus jucăria (linie, coloană), precum și locația unde trebuie corect pusă aceasta (linie, coloană), ajutați bona să reașeze jucăriile astfel încât numărul de mutării să fie minim. În cazul în care locația unde trebuie mutată o jucărie este ocupată, atunci bona depozitează temporar jucăria într-o locație specială, dacă este liberă, până când locația unde trebuie mutată se va elibera.

Să se determine:

  • numărul minim de mutări ce nu necesită folosirea locației speciale
  • numărul minim de mutări necesar rearanjării tuturor jucăriilor

Detalii

Problema bona Operații I/O bona.in/bona.out
Limita timp 0.2 secunde Limita memorie Total: 16 MB / Stivă 8 MB
Id soluție #51494609 Utilizator Alex Simina (alex2010)
Fișier bona.cpp Dimensiune 1.94 KB
Data încărcării 27 Iunie 2024, 22:32 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

In file included from /usr/include/c++/4.8/bits/hashtable.h:35:0,
                 from /usr/include/c++/4.8/unordered_set:47,
                 from bona.cpp:3:
/usr/include/c++/4.8/bits/hashtable_policy.h: In instantiation of 'struct std::__detail::_Hash_code_base<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >, std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >, std::__detail::_Identity, std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, true>':
/usr/include/c++/4.8/bits/hashtable_policy.h:1402:10:   required from 'struct std::__detail::_Hashtable_base<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >, std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >, std::__detail::_Identity, std::equal_to<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >, std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Hashtable_traits<true, true, true> >'
/usr/include/c++/4.8/bits/hashtable.h:174:11:   required from 'class std::_Hashtable<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >, std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >, std::allocator<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >, std::__detail::_Identity, std::equal_to<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >, std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, true, true> >'
/usr/include/c++/4.8/bits/unordered_set.h:96:18:   required from 'class std::unordered_set<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >'
bona.cpp:10:114:   required from here
/usr/include/c++/4.8/bits/hashtable_policy.h:1070:12: error: invalid use of incomplete type 'struct std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >'
     struct _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2,
            ^
In file included from /usr/include/c++/4.8/bits/basic_string.h:3033: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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from bona.cpp:1:
/usr/include/c++/4.8/bits/functional_hash.h:58:12: error: declaration of 'struct std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >'
     struct hash;
            ^
In file included from /usr/include/c++/4.8/bits/hashtable.h:35:0,
                 from /usr/include/c++/4.8/unordered_set:47,
                 from bona.cpp:3:
/usr/include/c++/4.8/bits/hashtable_policy.h:1070:12: error: invalid use of incomplete type 'struct std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >'
     struct _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2,
            ^
In file included from /usr/include/c++/4.8/bits/basic_string.h:3033: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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from bona.cpp:1:
/usr/include/c++/4.8/bits/functional_hash.h:58:12: error: declaration of 'struct std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >'
     struct hash;
            ^
In file included from /usr/include/c++/4.8/bits/hashtable.h:35:0,
                 from /usr/include/c++/4.8/unordered_set:47,
                 from bona.cpp:3:
/usr/include/c++/4.8/bits/hashtable_policy.h:1082:53: error: invalid use of incomplete type 'struct std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >'
       using __ebo_h1 = _Hashtable_ebo_helper<1, _H1>;
                                                     ^
In file included from /usr/include/c++/4.8/bits/basic_string.h:3033: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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from bona.cpp:1:
/usr/include/c++/4.8/bits/functional_hash.h:58:12: error: declaration of 'struct std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >'
     struct hash;
            ^
In file included from /usr/include/c++/4.8/bits/hashtable.h:35:0,
                 from /usr/include/c++/4.8/unordered_set:47,
                 from bona.cpp:3:
/usr/include/c++/4.8/bits/hashtable_policy.h:1082:53: error: invalid use of incomplete type 'struct std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >'
       using __ebo_h1 = _Hashtable_ebo_helper<1, _H1>;
                                                     ^
In file included from /usr/include/c++/4.8/bits/basic_string.h:3033: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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from bona.cpp:1:
/usr/include/c++/4.8/bits/functional_hash.h:58:12: error: declaration of 'struct std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >'
     struct hash;
            ^
bona.cpp: In constructor 'std::unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(std::unordered_set<_Value, _Hash, _Pred, _Alloc>::size_type, const hasher&, const key_equal&, const allocator_type&) [with _Value = std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >; _Hash = std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; _Pred = std::equal_to<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; _Alloc = std::allocator<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; std::unordered_set<_Value, _Hash, _Pred, _Alloc>::size_type = unsigned int; std::unordered_set<_Value, _Hash, _Pred, _Alloc>::hasher = std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; std::unordered_set<_Value, _Hash, _Pred, _Alloc>::key_equal = std::equal_to<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; std::unordered_set<_Value, _Hash, _Pred, _Alloc>::allocator_type = std::allocator<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >]':
bona.cpp:10:130: error: invalid use of incomplete type 'std::unordered_set<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >::hasher {aka struct std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >}'
 unordered_set <pair <pair<unsigned short int,unsigned short int>, pair<unsigned short int,unsigned short  int>>> pozJucarii{10001};

                                                                                                                                  ^
In file included from /usr/include/c++/4.8/bits/basic_string.h:3033: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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from bona.cpp:1:
/usr/include/c++/4.8/bits/functional_hash.h:58:12: error: declaration of 'std::unordered_set<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >::hasher {aka struct std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >}'
     struct hash;
            ^
bona.cpp:10:130: note:   when instantiating default argument for call to std::unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(std::unordered_set<_Value, _Hash, _Pred, _Alloc>::size_type, const hasher&, const key_equal&, const allocator_type&) [with _Value = std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >; _Hash = std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; _Pred = std::equal_to<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; _Alloc = std::allocator<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; std::unordered_set<_Value, _Hash, _Pred, _Alloc>::size_type = unsigned int; std::unordered_set<_Value, _Hash, _Pred, _Alloc>::hasher = std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; std::unordered_set<_Value, _Hash, _Pred, _Alloc>::key_equal = std::equal_to<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; std::unordered_set<_Value, _Hash, _Pred, _Alloc>::allocator_type = std::allocator<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >]
 unordered_set <pair <pair<unsigned short int,unsigned short int>, pair<unsigned short int,unsigned short  int>>> pozJucarii{10001};

                                                                                                                                  ^
In file included from /usr/include/c++/4.8/bits/hashtable.h:35:0,
                 from /usr/include/c++/4.8/unordered_set:47,
                 from bona.cpp:3:
/usr/include/c++/4.8/bits/hashtable_policy.h: In instantiation of 'std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, std::__detail::_Default_ranged_hash, true>::__hash_code std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, std::__detail::_Default_ranged_hash, true>::_M_hash_code(const _Key&) const [with _Key = std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >; _Value = std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >; _ExtractKey = std::__detail::_Identity; _H1 = std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; _H2 = std::__detail::_Mod_range_hashing; std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, std::__detail::_Default_ranged_hash, true>::__hash_code = unsigned int]':
/usr/include/c++/4.8/bits/hashtable.h:1418:45:   required from 'std::pair<typename std::__detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2, _Hash, _Traits>::iterator, bool> std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::_M_insert(_Arg&&, std::true_type) [with _Arg = std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >; _Key = std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >; _Value = std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >; _Alloc = std::allocator<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; _ExtractKey = std::__detail::_Identity; _Equal = std::equal_to<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; _H1 = std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short 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<true, true, true>; typename std::__detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2, _Hash, _Traits>::iterator = std::__detail::_Node_iterator<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >, true, true>; std::true_type = std::integral_constant<bool, true>]'
/usr/include/c++/4.8/bits/hashtable_policy.h:689:54:   required from 'std::pair<typename std::__detail::_Insert_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::iterator, bool> std::__detail::_Insert<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits, true, true>::insert(std::__detail::_Insert<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits, true, true>::value_type&&) [with _Key = std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >; _Value = std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >; _Alloc = std::allocator<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; _ExtractKey = std::__detail::_Identity; _Equal = std::equal_to<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; _H1 = std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short 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<true, true, true>; typename std::__detail::_Insert_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::iterator = std::__detail::_Node_iterator<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >, true, true>; std::__detail::_Insert<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits, true, true>::value_type = std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >]'
/usr/include/c++/4.8/bits/unordered_set.h:349:42:   required from 'std::pair<typename std::_Hashtable<_Value, _Value, _Alloc, std::__detail::_Identity, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::is_default_constructible<_Hash>, std::is_copy_assignable<_Hash>, std::__detail::__is_noexcept_hash<_Tp, _Hash> > >::value, true, true> >::iterator, bool> std::unordered_set<_Value, _Hash, _Pred, _Alloc>::insert(std::unordered_set<_Value, _Hash, _Pred, _Alloc>::value_type&&) [with _Value = std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >; _Hash = std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; _Pred = std::equal_to<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; _Alloc = std::allocator<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; typename std::_Hashtable<_Value, _Value, _Alloc, std::__detail::_Identity, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::is_default_constructible<_Hash>, std::is_copy_assignable<_Hash>, std::__detail::__is_noexcept_hash<_Tp, _Hash> > >::value, true, true> >::iterator = std::__detail::_Node_iterator<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >, true, true>; std::unordered_set<_Value, _Hash, _Pred, _Alloc>::value_type = std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >]'
bona.cpp:26:51:   required from here
/usr/include/c++/4.8/bits/hashtable_policy.h:1103:22: error: no match for call to '(const std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >) (const std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >&)'
       { return _M_h1()(__k); }
                      ^
/usr/include/c++/4.8/bits/hashtable_policy.h: In instantiation of 'std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, std::__detail::_Default_ranged_hash, true>::_Hash_code_base(const _ExtractKey&, const _H1&, const _H2&, const std::__detail::_Default_ranged_hash&) [with _Key = std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >; _Value = std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >; _ExtractKey = std::__detail::_Identity; _H1 = std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; _H2 = std::__detail::_Mod_range_hashing]':
/usr/include/c++/4.8/bits/hashtable_policy.h:1463:65:   required from 'std::__detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2, _Hash, _Traits>::_Hashtable_base(const _ExtractKey&, const _H1&, const _H2&, const _Hash&, const _Equal&) [with _Key = std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >; _Value = std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >; _ExtractKey = std::__detail::_Identity; _Equal = std::equal_to<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; _H1 = std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _Traits = std::__detail::_Hashtable_traits<true, true, true>]'
/usr/include/c++/4.8/bits/hashtable.h:828:24:   required from 'std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::_Hashtable(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 _Key = std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >; _Value = std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >; _Alloc = std::allocator<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; _ExtractKey = std::__detail::_Identity; _Equal = std::equal_to<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; _H1 = std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short 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<true, true, 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<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >]'
/usr/include/c++/4.8/bits/hashtable.h:397:26:   required from 'std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::_Hashtable(std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::size_type, const _H1&, const key_equal&, const allocator_type&) [with _Key = std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >; _Value = std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >; _Alloc = std::allocator<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; _ExtractKey = std::__detail::_Identity; _Equal = std::equal_to<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; _H1 = std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short 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<true, true, 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<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::allocator_type = std::allocator<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >]'
/usr/include/c++/4.8/bits/unordered_set.h:136:35:   required from 'std::unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(std::unordered_set<_Value, _Hash, _Pred, _Alloc>::size_type, const hasher&, const key_equal&, const allocator_type&) [with _Value = std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> >; _Hash = std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; _Pred = std::equal_to<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; _Alloc = std::allocator<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; std::unordered_set<_Value, _Hash, _Pred, _Alloc>::size_type = unsigned int; std::unordered_set<_Value, _Hash, _Pred, _Alloc>::hasher = std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; std::unordered_set<_Value, _Hash, _Pred, _Alloc>::key_equal = std::equal_to<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >; std::unordered_set<_Value, _Hash, _Pred, _Alloc>::allocator_type = std::allocator<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >]'
bona.cpp:10:130:   required from here
/usr/include/c++/4.8/bits/hashtable_policy.h:1099:63: error: invalid use of incomplete type 'struct std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >'
       : __ebo_extract_key(__ex), __ebo_h1(__h1), __ebo_h2(__h2) { }
                                                               ^
In file included from /usr/include/c++/4.8/bits/basic_string.h:3033: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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from bona.cpp:1:
/usr/include/c++/4.8/bits/functional_hash.h:58:12: error: declaration of 'struct std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >'
     struct hash;
            ^
In file included from /usr/include/c++/4.8/bits/hashtable.h:35:0,
                 from /usr/include/c++/4.8/unordered_set:47,
                 from bona.cpp:3:
/usr/include/c++/4.8/bits/hashtable_policy.h:1099:63: error: invalid use of incomplete type 'struct std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >'
       : __ebo_extract_key(__ex), __ebo_h1(__h1), __ebo_h2(__h2) { }
                                                               ^
In file included from /usr/include/c++/4.8/bits/basic_string.h:3033: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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from bona.cpp:1:
/usr/include/c++/4.8/bits/functional_hash.h:58:12: error: declaration of 'struct std::hash<std::pair<std::pair<short unsigned int, short unsigned int>, std::pair<short unsigned int, short unsigned int> > >'
     struct hash;
            ^

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