#401
Pachete_Multe
Într-un depozit foarte mare există un raft cu n+1
spații de depozitare, numerotate de la 1
la n+1
. Primele n
spatii de depozitare sunt ocupate cu n
pachete numerotate cu valori între 1
și n
, iar spațiul de depozitare n+1
este gol.
Administratorul depozitului decide mutarea pachetelor, astfel încât pentru orice i
, pachetul numerotat cu i
să se afle în spațiul de depozitare i
. Pentru aceasta se va folosi spațiul de depozitare suplimentar, n+1
, singura manevră validă fiind mutarea unui pachet dintr-un spațiu de depozitare în altul, cu condiția ca acesta să fie gol.
Determinați o succesiune de manevre prin care fiecare pachet să fie în spațiul corect.
Problema | Pachete_Multe | Operații I/O |
pachete_multe.in /pachete_multe.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54236559 | Utilizator | |
Fișier | pachete_multe.cpp | Dimensiune | 747 B |
Data încărcării | 22 Noiembrie 2024, 23:53 | Scor / rezultat | Eroare de compilare |
pachete_multe.cpp: In function 'int main()': pachete_multe.cpp:16:13: error: reference to 'move' is ambiguous move.add(make_pair(i,liber)); ^ pachete_multe.cpp:6:24: note: candidates are: std::vector<std::pair<int, int> > move vector <pair<int,int>> move; ^ In file included from /usr/include/c++/4.8/deque:64:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:67, from pachete_multe.cpp:1: /usr/include/c++/4.8/bits/stl_deque.h:403:5: note: template<class _Tp> std::_Deque_iterator<_Tp, _Tp&, _Tp*> std::move(std::_Deque_iterator<_Tp, _Tp&, _Tp*>, std::_Deque_iterator<_Tp, _Tp&, _Tp*>, std::_Deque_iterator<_Tp, _Tp&, _Tp*>) move(_Deque_iterator<_Tp, _Tp&, _Tp*> __first, ^ In file included from /usr/include/c++/4.8/deque:66:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:67, from pachete_multe.cpp:1: /usr/include/c++/4.8/bits/deque.tcc:1004:5: note: template<class _Tp> std::_Deque_iterator<_Tp, _Tp&, _Tp*> std::move(std::_Deque_iterator<_Tp, const _Tp&, const _Tp*>, std::_Deque_iterator<_Tp, const _Tp&, const _Tp*>, std::_Deque_iterator<_Tp, _Tp&, _Tp*>) move(_Deque_iterator<_Tp, const _Tp&, const _Tp*> __first, ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, 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 pachete_multe.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:483:5: note: template<class _II, class _OI> _OI std::move(_II, _II, _OI) move(_II __first, _II __last, _OI __result) ^ In file included from /usr/include/c++/4.8/bits/stl_pair.h:59:0, 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 pachete_multe.cpp:1: /usr/include/c++/4.8/bits/move.h:101:5: note: template<class _Tp> constexpr typename std::remove_reference< <template-parameter-1-1> >::type&& std::move(_Tp&&) move(_Tp&& __t) noexcept ^ pachete_multe.cpp:18:9: error: reference to 'move' is ambiguous move.add(make_pair(loc[i],i)); ^ pachete_multe.cpp:6:24: note: candidates are: std::vector<std::pair<int, int> > move vector <pair<int,int>> move; ^ In file included from /usr/include/c++/4.8/deque:64:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:67, from pachete_multe.cpp:1: /usr/include/c++/4.8/bits/stl_deque.h:403:5: note: template<class _Tp> std::_Deque_iterator<_Tp, _Tp&, _Tp*> std::move(std::_Deque_iterator<_Tp, _Tp&, _Tp*>, std::_Deque_iterator<_Tp, _Tp&, _Tp*>, std::_Deque_iterator<_Tp, _Tp&, _Tp*>) move(_Deque_iterator<_Tp, _Tp&, _Tp*> __first, ^ In file included from /usr/include/c++/4.8/deque:66:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:67, from pachete_multe.cpp:1: /usr/include/c++/4.8/bits/deque.tcc:1004:5: note: template<class _Tp> std::_Deque_iterator<_Tp, _Tp&, _Tp*> std::move(std::_Deque_iterator<_Tp, const _Tp&, const _Tp*>, std::_Deque_iterator<_Tp, const _Tp&, const _Tp*>, std::_Deque_iterator<_Tp, _Tp&, _Tp*>) move(_Deque_iterator<_Tp, const _Tp&, const _Tp*> __first, ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, 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 pachete_multe.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:483:5: note: template<class _II, class _OI> _OI std::move(_II, _II, _OI) move(_II __first, _II __last, _OI __result) ^ In file included from /usr/include/c++/4.8/bits/stl_pair.h:59:0, 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 pachete_multe.cpp:1: /usr/include/c++/4.8/bits/move.h:101:5: note: template<class _Tp> constexpr typename std::remove_reference< <template-parameter-1-1> >::type&& std::move(_Tp&&) move(_Tp&& __t) noexcept ^ pachete_multe.cpp:21:13: error: reference to 'move' is ambiguous fout << move.size() << '\n'; ^ pachete_multe.cpp:6:24: note: candidates are: std::vector<std::pair<int, int> > move vector <pair<int,int>> move; ^ In file included from /usr/include/c++/4.8/deque:64:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:67, from pachete_multe.cpp:1: /usr/include/c++/4.8/bits/stl_deque.h:403:5: note: template<class _Tp> std::_Deque_iterator<_Tp, _Tp&, _Tp*> std::move(std::_Deque_iterator<_Tp, _Tp&, _Tp*>, std::_Deque_iterator<_Tp, _Tp&, _Tp*>, std::_Deque_iterator<_Tp, _Tp&, _Tp*>) move(_Deque_iterator<_Tp, _Tp&, _Tp*> __first, ^ In file included from /usr/include/c++/4.8/deque:66:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:67, from pachete_multe.cpp:1: /usr/include/c++/4.8/bits/deque.tcc:1004:5: note: template<class _Tp> std::_Deque_iterator<_Tp, _Tp&, _Tp*> std::move(std::_Deque_iterator<_Tp, const _Tp&, const _Tp*>, std::_Deque_iterator<_Tp, const _Tp&, const _Tp*>, std::_Deque_iterator<_Tp, _Tp&, _Tp*>) move(_Deque_iterator<_Tp, const _Tp&, const _Tp*> __first, ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, 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 pachete_multe.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:483:5: note: template<class _II, class _OI> _OI std::move(_II, _II, _OI) move(_II __first, _II __last, _OI __result) ^ In file included from /usr/include/c++/4.8/bits/stl_pair.h:59:0, 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 pachete_multe.cpp:1: /usr/include/c++/4.8/bits/move.h:101:5: note: template<class _Tp> constexpr typename std::remove_reference< <template-parameter-1-1> >::type&& std::move(_Tp&&) move(_Tp&& __t) noexcept ^ pachete_multe.cpp:22:23: error: reference to 'move' is ambiguous for(int i = 0;i < move.size(); ++i) ^ pachete_multe.cpp:6:24: note: candidates are: std::vector<std::pair<int, int> > move vector <pair<int,int>> move; ^ In file included from /usr/include/c++/4.8/deque:64:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:67, from pachete_multe.cpp:1: /usr/include/c++/4.8/bits/stl_deque.h:403:5: note: template<class _Tp> std::_Deque_iterator<_Tp, _Tp&, _Tp*> std::move(std::_Deque_iterator<_Tp, _Tp&, _Tp*>, std::_Deque_iterator<_Tp, _Tp&, _Tp*>, std::_Deque_iterator<_Tp, _Tp&, _Tp*>) move(_Deque_iterator<_Tp, _Tp&, _Tp*> __first, ^ In file included from /usr/include/c++/4.8/deque:66:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:67, from pachete_multe.cpp:1: /usr/include/c++/4.8/bits/deque.tcc:1004:5: note: template<class _Tp> std::_Deque_iterator<_Tp, _Tp&, _Tp*> std::move(std::_Deque_iterator<_Tp, const _Tp&, const _Tp*>, std::_Deque_iterator<_Tp, const _Tp&, const _Tp*>, std::_Deque_iterator<_Tp, _Tp&, _Tp*>) move(_Deque_iterator<_Tp, const _Tp&, const _Tp*> __first, ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, 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 pachete_multe.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:483:5: note: template<class _II, class _OI> _OI std::move(_II, _II, _OI) move(_II __first, _II __last, _OI __result) ^ In file included from /usr/include/c++/4.8/bits/stl_pair.h:59:0, 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 pachete_multe.cpp:1: /usr/include/c++/4.8/bits/move.h:101:5: note: template<class _Tp> constexpr typename std::remove_reference< <template-parameter-1-1> >::type&& std::move(_Tp&&) move(_Tp&& __t) noexcept ^ pachete_multe.cpp:23:17: error: reference to 'move' is ambiguous fout << move[i].first << ' ' << move[i].second << '\n'; ^ pachete_multe.cpp:6:24: note: candidates are: std::vector<std::pair<int, int> > move vector <pair<int,int>> move; ^ In file included from /usr/include/c++/4.8/deque:64:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:67, from pachete_multe.cpp:1: /usr/include/c++/4.8/bits/stl_deque.h:403:5: note: template<class _Tp> std::_Deque_iterator<_Tp, _Tp&, _Tp*> std::move(std::_Deque_iterator<_Tp, _Tp&, _Tp*>, std::_Deque_iterator<_Tp, _Tp&, _Tp*>, std::_Deque_iterator<_Tp, _Tp&, _Tp*>) move(_Deque_iterator<_Tp, _Tp&, _Tp*> __first, ^ In file included from /usr/include/c++/4.8/deque:66:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:67, from pachete_multe.cpp:1: /usr/include/c++/4.8/bits/deque.tcc:1004:5: note: template<class _Tp> std::_Deque_iterator<_Tp, _Tp&, _Tp*> std::move(std::_Deque_iterator<_Tp, const _Tp&, const _Tp*>, std::_Deque_iterator<_Tp, const _Tp&, const _Tp*>, std::_Deque_iterator<_Tp, _Tp&, _Tp*>) move(_Deque_iterator<_Tp, const _Tp&, const _Tp*> __first, ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, 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 pachete_multe.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:483:5: note: template<class _II, class _OI> _OI std::move(_II, _II, _OI) move(_II __first, _II __last, _OI __result) ^ In file included from /usr/include/c++/4.8/bits/stl_pair.h:59:0, 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 pachete_multe.cpp:1: /usr/include/c++/4.8/bits/move.h:101:5: note: template<class _Tp> constexpr typename std::remove_reference< <template-parameter-1-1> >::type&& std::move(_Tp&&) move(_Tp&& __t) noexcept ^ pachete_multe.cpp:23:41: error: reference to 'move' is ambiguous fout << move[i].first << ' ' << move[i].second << '\n'; ^ pachete_multe.cpp:6:24: note: candidates are: std::vector<std::pair<int, int> > move vector <pair<int,int>> move; ^ In file included from /usr/include/c++/4.8/deque:64:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:67, from pachete_multe.cpp:1: /usr/include/c++/4.8/bits/stl_deque.h:403:5: note: template<class _Tp> std::_Deque_iterator<_Tp, _Tp&, _Tp*> std::move(std::_Deque_iterator<_Tp, _Tp&, _Tp*>, std::_Deque_iterator<_Tp, _Tp&, _Tp*>, std::_Deque_iterator<_Tp, _Tp&, _Tp*>) move(_Deque_iterator<_Tp, _Tp&, _Tp*> __first, ^ In file included from /usr/include/c++/4.8/deque:66:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:67, from pachete_multe.cpp:1: /usr/include/c++/4.8/bits/deque.tcc:1004:5: note: template<class _Tp> std::_Deque_iterator<_Tp, _Tp&, _Tp*> std::move(std::_Deque_iterator<_Tp, const _Tp&, const _Tp*>, std::_Deque_iterator<_Tp, const _Tp&, const _Tp*>, std::_Deque_iterator<_Tp, _Tp&, _Tp*>) move(_Deque_iterator<_Tp, const _Tp&, const _Tp*> __first, ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, 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 pachete_multe.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:483:5: note: template<class _II, class _OI> _OI std::move(_II, _II, _OI) move(_II __first, _II __last, _OI __result) ^ In file included from /usr/include/c++/4.8/bits/stl_pair.h:59:0, 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 pachete_multe.cpp:1: /usr/include/c++/4.8/bits/move.h:101:5: note: template<class _Tp> constexpr typename std::remove_reference< <template-parameter-1-1> >::type&& std::move(_Tp&&) move(_Tp&& __t) noexcept ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Pachete_Multe 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ă.