#3801
LsiInterclasare
C++
Să se scrie o funcție care interclasează nodurile a două liste.
Folclorul informatic
Problema | LsiInterclasare | Operații I/O |
lsiinterclasare.in /lsiinterclasare.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 16 MB
/
Stivă 8 MB
|
Id soluție | #36509049 | Utilizator | |
Fișier | lsiinterclasare.cpp | Dimensiune | 556 B |
Data încărcării | 05 Mai 2022, 20:56 | Scor / rezultat | Eroare de compilare |
lsiinterclasare.cpp:53:8: error: redefinition of 'struct Nod' struct Nod ^ lsiinterclasare.cpp:4:8: error: previous definition of 'struct Nod' struct Nod ^ lsiinterclasare.cpp: In function 'void LsiInterclasare(Nod*, Nod*, Nod*&)': lsiinterclasare.cpp:60:9: error: no matching function for call to 'Nod::Nod()' Nod p,q,aux; ^ lsiinterclasare.cpp:60:9: note: candidates are: lsiinterclasare.cpp:8:5: note: Nod::Nod(int, int) Nod(int _id, int x) ^ lsiinterclasare.cpp:8:5: note: candidate expects 2 arguments, 0 provided lsiinterclasare.cpp:4:8: note: constexpr Nod::Nod(const Nod&) struct Nod ^ lsiinterclasare.cpp:4:8: note: candidate expects 1 argument, 0 provided lsiinterclasare.cpp:4:8: note: constexpr Nod::Nod(Nod&&) lsiinterclasare.cpp:4:8: note: candidate expects 1 argument, 0 provided lsiinterclasare.cpp:60:11: error: no matching function for call to 'Nod::Nod()' Nod p,q,aux; ^ lsiinterclasare.cpp:60:11: note: candidates are: lsiinterclasare.cpp:8:5: note: Nod::Nod(int, int) Nod(int _id, int x) ^ lsiinterclasare.cpp:8:5: note: candidate expects 2 arguments, 0 provided lsiinterclasare.cpp:4:8: note: constexpr Nod::Nod(const Nod&) struct Nod ^ lsiinterclasare.cpp:4:8: note: candidate expects 1 argument, 0 provided lsiinterclasare.cpp:4:8: note: constexpr Nod::Nod(Nod&&) lsiinterclasare.cpp:4:8: note: candidate expects 1 argument, 0 provided lsiinterclasare.cpp:60:13: error: no matching function for call to 'Nod::Nod()' Nod p,q,aux; ^ lsiinterclasare.cpp:60:13: note: candidates are: lsiinterclasare.cpp:8:5: note: Nod::Nod(int, int) Nod(int _id, int x) ^ lsiinterclasare.cpp:8:5: note: candidate expects 2 arguments, 0 provided lsiinterclasare.cpp:4:8: note: constexpr Nod::Nod(const Nod&) struct Nod ^ lsiinterclasare.cpp:4:8: note: candidate expects 1 argument, 0 provided lsiinterclasare.cpp:4:8: note: constexpr Nod::Nod(Nod&&) lsiinterclasare.cpp:4:8: note: candidate expects 1 argument, 0 provided lsiinterclasare.cpp:74:10: error: no match for 'operator=' (operand types are 'Nod' and 'Nod*') p=h1; ^ lsiinterclasare.cpp:74:10: note: candidates are: lsiinterclasare.cpp:4:8: note: Nod& Nod::operator=(const Nod&) struct Nod ^ lsiinterclasare.cpp:4:8: note: no known conversion for argument 1 from 'Nod*' to 'const Nod&' lsiinterclasare.cpp:4:8: note: Nod& Nod::operator=(Nod&&) lsiinterclasare.cpp:4:8: note: no known conversion for argument 1 from 'Nod*' to 'Nod&&' lsiinterclasare.cpp:75:10: error: no match for 'operator=' (operand types are 'Nod' and 'Nod*') q=h2; ^ lsiinterclasare.cpp:75:10: note: candidates are: lsiinterclasare.cpp:4:8: note: Nod& Nod::operator=(const Nod&) struct Nod ^ lsiinterclasare.cpp:4:8: note: no known conversion for argument 1 from 'Nod*' to 'const Nod&' lsiinterclasare.cpp:4:8: note: Nod& Nod::operator=(Nod&&) lsiinterclasare.cpp:4:8: note: no known conversion for argument 1 from 'Nod*' to 'Nod&&' lsiinterclasare.cpp:80:10: error: no match for 'operator=' (operand types are 'Nod' and 'Nod*') p=h2; ^ lsiinterclasare.cpp:80:10: note: candidates are: lsiinterclasare.cpp:4:8: note: Nod& Nod::operator=(const Nod&) struct Nod ^ lsiinterclasare.cpp:4:8: note: no known conversion for argument 1 from 'Nod*' to 'const Nod&' lsiinterclasare.cpp:4:8: note: Nod& Nod::operator=(Nod&&) lsiinterclasare.cpp:4:8: note: no known conversion for argument 1 from 'Nod*' to 'Nod&&' lsiinterclasare.cpp:81:10: error: no match for 'operator=' (operand types are 'Nod' and 'Nod*') q=h1; ^ lsiinterclasare.cpp:81:10: note: candidates are: lsiinterclasare.cpp:4:8: note: Nod& Nod::operator=(const Nod&) struct Nod ^ lsiinterclasare.cpp:4:8: note: no known conversion for argument 1 from 'Nod*' to 'const Nod&' lsiinterclasare.cpp:4:8: note: Nod& Nod::operator=(Nod&&) lsiinterclasare.cpp:4:8: note: no known conversion for argument 1 from 'Nod*' to 'Nod&&' lsiinterclasare.cpp:83:13: error: no match for 'operator&&' (operand types are 'Nod' and 'Nod') while(p && q) ^ lsiinterclasare.cpp:83:13: note: candidates are: lsiinterclasare.cpp:83:13: note: operator&&(bool, bool) <built-in> lsiinterclasare.cpp:83:13: note: no known conversion for argument 2 from 'Nod' to 'bool' In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from lsiinterclasare.cpp:1: /usr/include/c++/4.8/bits/valarray_after.h:412:5: note: template<class _Dom1, class _Dom2> std::_Expr<std::_BinClos<std::__logical_and, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::_Expr<_Dom2, typename _Dom2::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(&&, __logical_and) ^ /usr/include/c++/4.8/bits/valarray_after.h:412:5: note: template argument deduction/substitution failed: lsiinterclasare.cpp:83:16: note: 'Nod' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' while(p && q) ^ In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from lsiinterclasare.cpp:1: /usr/include/c++/4.8/bits/valarray_after.h:412:5: note: template<class _Dom> std::_Expr<std::_BinClos<std::__logical_and, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&) _DEFINE_EXPR_BINARY_OPERATOR(&&, __logical_and) ^ /usr/include/c++/4.8/bits/valarray_after.h:412:5: note: template argument deduction/substitution failed: lsiinterclasare.cpp:83:16: note: 'Nod' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' while(p && q) ^ In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from lsiinterclasare.cpp:1: /usr/include/c++/4.8/bits/valarray_after.h:412:5: note: template<class _Dom> std::_Expr<std::_BinClos<std::__logical_and, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const typename _Dom::value_type&, const std::_Expr<_Dom1, typename _Dom1::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(&&, __logical_and) ^ /usr/include/c++/4.8/bits/valarray_after.h:412:5: note: template argument deduction/substitution failed: lsiinterclasare.cpp:83:16: note: 'Nod' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' while(p && q) ^ In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from lsiinterclasare.cpp:1: /usr/include/c++/4.8/bits/valarray_after.h:412:5: note: template<class _Dom> std::_Expr<std::_BinClos<std::__logical_and, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::valarray<typename _Dom::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(&&, __logical_and) ^ /usr/include/c++/4.8/bits/valarray_after.h:412:5: note: template argument deduction/substitution failed: lsiinterclasare.cpp:83:16: note: 'Nod' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' while(p && q) ^ In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from lsiinterclasare.cpp:1: /usr/include/c++/4.8/bits/valarray_after.h:412:5: note: template<class _Dom> std::_Expr<std::_BinClos<std::__logical_and, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const std::valarray<typename _Dom::value_type>&, const std::_Expr<_Dom1, typename _Dom1::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(&&, __logical_and) ^ /usr/include/c++/4.8/bits/valarray_after.h:412:5: note: template argument deduction/substitution failed: lsiinterclasare.cpp:83:16: note: 'Nod' is not derived from 'const std::valarray<typename _Dom::value_type>' while(p && q) ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94:0, from lsiinterclasare.cpp:1: /usr/include/c++/4.8/valarray:1177:1: note: template<class _Tp> std::_Expr<std::_BinClos<std::__logical_and, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__logical_and, _Tp>::result_type> std::operator&&(const std::valarray<_Tp>&, const std::valarray<_Tp>&) _DEFINE_BINARY_OPERATOR(&&, __logical_and) ^ /usr/include/c++/4.8/valarray:1177:1: note: template argument deduction/substitution failed: lsiinterclasare.cpp:83:16: note: 'Nod' is not derived from 'const std::valarray<_Tp>' while(p && q) ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94:0, from lsiinterclasare.cpp:1: /usr/include/c++/4.8/valarray:1177:1: note: template<class _Tp> std::_Expr<std::_BinClos<std::__logical_and, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__logical_and, _Tp>::result_type> std::operator&&(const std::valarray<_Tp>&, const _Tp&) _DEFINE_BINARY_OPERATOR(&&, __logical_and) ^ /usr/include/c++/4.8/valarray:1177:1: note: template argument deduction/substitution failed: lsiinterclasare.cpp:83:16: note: 'Nod' is not derived from 'const std::valarray<_Tp>' while(p && q) ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94:0, from lsiinterclasare.cpp:1: /usr/include/c++/4.8/valarray:1177:1: note: template<class _Tp> std::_Expr<std::_BinClos<std::__logical_and, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__logical_and, _Tp>::result_type> std::operator&&(const _Tp&, const std::valarray<_Tp>&) _DEFINE_BINARY_OPERATOR(&&, __logical_and) ^ /usr/include/c++/4.8/valarray:1177:1: note: template argument deduction/substitution failed: lsiinterclasare.cpp:83:16: note: 'Nod' is not derived from 'const std::valarray<_Tp>' while(p && q) ^ lsiinterclasare.cpp:85:13: error: base operand of '->' has non-pointer type 'Nod' while(p->leg && p->leg->info <=q->info) ^ lsiinterclasare.cpp:85:23: error: base operand of '->' has non-pointer type 'Nod' while(p->leg && p->leg->info <=q->info) ^ lsiinterclasare.cpp:85:38: error: base operand of '->' has non-pointer type 'Nod' while(p->leg && p->leg->info <=q->info) ^ lsiinterclasare.cpp:86:14: error: base operand of '->' has non-pointer type 'Nod' p=p->leg; ^ lsiinterclasare.cpp:87:12: error: base operand of '->' has non-pointer type 'Nod' aux=p->leg; ^ lsiinterclasare.cpp:88:8: error: base operand of '->' has non-pointer type 'Nod' p->leg=q; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema LsiInterclasare face parte din a doua categorie. Pentru aceste probleme se folosește un program suport, furnizat de propunătorul problemei. 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ă.