#190
Oglindiri
Se dă un vector cu elemente numere naturale.
Să se afișeze elementele vectorului, după realizarea unor operații de oglindire a unor secvențe date.
Problema | Oglindiri | Operații I/O |
![]() oglindiri.in /oglindiri.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #51171780 | Utilizator | |
Fișier | oglindiri.cpp | Dimensiune | 649 B |
Data încărcării | 28 Mai 2024, 11:50 | Scor / rezultat | Eroare de compilare |
oglindiri.cpp: In function 'int main()': oglindiri.cpp:32:33: error: no matching function for call to 'swap(bool)' swap(v[st]<v[dr]) ^ oglindiri.cpp:32:33: note: candidates are: 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/fstream:38, from oglindiri.cpp:13: /usr/include/c++/4.8/bits/move.h:166:5: note: template<class _Tp> void std::swap(_Tp&, _Tp&) swap(_Tp& __a, _Tp& __b) ^ /usr/include/c++/4.8/bits/move.h:166:5: note: template argument deduction/substitution failed: oglindiri.cpp:32:33: note: candidate expects 2 arguments, 1 provided swap(v[st]<v[dr]) ^ 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/fstream:38, from oglindiri.cpp:13: /usr/include/c++/4.8/bits/move.h:185:5: note: template<class _Tp, unsigned int _Nm> void std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm]) swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm]) ^ /usr/include/c++/4.8/bits/move.h:185:5: note: template argument deduction/substitution failed: oglindiri.cpp:32:33: note: mismatched types '_Tp [_Nm]' and 'bool' swap(v[st]<v[dr]) ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0, 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/fstream:38, from oglindiri.cpp:13: /usr/include/c++/4.8/bits/stl_pair.h:254:5: note: template<class _T1, class _T2> void std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&) swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y) ^ /usr/include/c++/4.8/bits/stl_pair.h:254:5: note: template argument deduction/substitution failed: oglindiri.cpp:32:33: note: mismatched types 'std::pair<_T1, _T2>' and 'bool' swap(v[st]<v[dr]) ^ In file included from /usr/include/c++/4.8/string:52: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/fstream:38, from oglindiri.cpp:13: /usr/include/c++/4.8/bits/basic_string.h:2717:5: note: template<class _CharT, class _Traits, class _Alloc> void std::swap(std::basic_string<_CharT, _Traits, _Alloc>&, std::basic_string<_CharT, _Traits, _Alloc>&) swap(basic_string<_CharT, _Traits, _Alloc>& __lhs, ^ /usr/include/c++/4.8/bits/basic_string.h:2717:5: note: template argument deduction/substitution failed: oglindiri.cpp:32:33: note: mismatched types 'std::basic_string<_CharT, _Traits, _Alloc>' and 'bool' swap(v[st]<v[dr]) ^ In file included from /usr/include/c++/4.8/vector:64:0, from /usr/include/c++/4.8/bits/random.h:34, from /usr/include/c++/4.8/random:50, from /usr/include/c++/4.8/bits/stl_algo.h:65, from /usr/include/c++/4.8/algorithm:62, from oglindiri.cpp:14: /usr/include/c++/4.8/bits/stl_vector.h:1452:5: note: template<class _Tp, class _Alloc> void std::swap(std::vector<_Tp, _Alloc>&, std::vector<_Tp, _Alloc>&) swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>& __y) ^ /usr/include/c++/4.8/bits/stl_vector.h:1452:5: note: template argument deduction/substitution failed: oglindiri.cpp:32:33: note: mismatched types 'std::vector<_Tp, _Alloc>' and 'bool' swap(v[st]<v[dr]) ^ In file included from /usr/include/c++/4.8/vector:65:0, from /usr/include/c++/4.8/bits/random.h:34, from /usr/include/c++/4.8/random:50, from /usr/include/c++/4.8/bits/stl_algo.h:65, from /usr/include/c++/4.8/algorithm:62, from oglindiri.cpp:14: /usr/include/c++/4.8/bits/stl_bvector.h:112:3: note: void std::swap(std::_Bit_reference, std::_Bit_reference) swap(_Bit_reference __x, _Bit_reference __y) noexcept ^ /usr/include/c++/4.8/bits/stl_bvector.h:112:3: note: candidate expects 2 arguments, 1 provided /usr/include/c++/4.8/bits/stl_bvector.h:120:3: note: void std::swap(std::_Bit_reference, bool&) swap(_Bit_reference __x, bool& __y) noexcept ^ /usr/include/c++/4.8/bits/stl_bvector.h:120:3: note: candidate expects 2 arguments, 1 provided /usr/include/c++/4.8/bits/stl_bvector.h:128:3: note: void std::swap(bool&, std::_Bit_reference) swap(bool& __x, _Bit_reference __y) noexcept ^ /usr/include/c++/4.8/bits/stl_bvector.h:128:3: note: candidate expects 2 arguments, 1 provided In file included from /usr/include/c++/4.8/tuple:39:0, from /usr/include/c++/4.8/functional:55, from /usr/include/c++/4.8/bits/stl_algo.h:66, from /usr/include/c++/4.8/algorithm:62, from oglindiri.cpp:14: /usr/include/c++/4.8/array:262:5: note: template<class _Tp, unsigned int _Nm> void std::swap(std::array<_Tp, _Nm>&, std::array<_Tp, _Nm>&) swap(array<_Tp, _Nm>& __one, array<_Tp, _Nm>& __two) ^ /usr/include/c++/4.8/array:262:5: note: template argument deduction/substitution failed: oglindiri.cpp:32:33: note: mismatched types 'std::array<_Tp, _Nm>' and 'bool' swap(v[st]<v[dr]) ^ In file included from /usr/include/c++/4.8/functional:55:0, from /usr/include/c++/4.8/bits/stl_algo.h:66, from /usr/include/c++/4.8/algorithm:62, from oglindiri.cpp:14: /usr/include/c++/4.8/tuple:1050:5: note: template<class ... _Elements> void std::swap(std::tuple<_Elements ...>&, std::tuple<_Elements ...>&) swap(tuple<_Elements...>& __x, tuple<_Elements...>& __y) ^ /usr/include/c++/4.8/tuple:1050:5: note: template argument deduction/substitution failed: oglindiri.cpp:32:33: note: mismatched types 'std::tuple<_Elements ...>' and 'bool' swap(v[st]<v[dr]) ^ In file included from /usr/include/c++/4.8/bits/stl_algo.h:66:0, from /usr/include/c++/4.8/algorithm:62, from oglindiri.cpp:14: /usr/include/c++/4.8/functional:2573:5: note: template<class _Res, class ... _Args> void std::swap(std::function<_Res(_ArgTypes ...)>&, std::function<_Res(_ArgTypes ...)>&) swap(function<_Res(_Args...)>& __x, function<_Res(_Args...)>& __y) ^ /usr/include/c++/4.8/functional:2573:5: note: template argument deduction/substitution failed: oglindiri.cpp:32:33: note: mismatched types 'std::function<_Res(_ArgTypes ...)>' and 'bool' swap(v[st]<v[dr]) ^ oglindiri.cpp:33:21: error: expected ';' before 'st' st++; ^ oglindiri.cpp:22:13: warning: unused variable 'j' [-Wunused-variable] int n,i,j,m,st,dr; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Oglindiri 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ă.