Detalii evaluare #36508991

Rezumat problemă

Să se scrie o funcție care interclasează nodurile a două liste.

Detalii

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 #36508991 Utilizator Rotaru Razvan (razvanalexrotaru)
Fișier lsiinterclasare.cpp Dimensiune 511 B
Data încărcării 05 Mai 2022, 20:53 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

lsiinterclasare.cpp: In function 'void LsiInterclasare(Nod*, Nod*, Nod*)':
lsiinterclasare.cpp:55:9: error: no matching function for call to 'Nod::Nod()'
     Nod p,q,aux;

         ^
lsiinterclasare.cpp:55: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:55:11: error: no matching function for call to 'Nod::Nod()'
     Nod p,q,aux;

           ^
lsiinterclasare.cpp:55: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:55:13: error: no matching function for call to 'Nod::Nod()'
     Nod p,q,aux;

             ^
lsiinterclasare.cpp:55: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:69:10: error: no match for 'operator=' (operand types are 'Nod' and 'Nod*')
         p=L1;

          ^
lsiinterclasare.cpp:69: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:70:10: error: no match for 'operator=' (operand types are 'Nod' and 'Nod*')
         q=L2;

          ^
lsiinterclasare.cpp:70: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*')
         p=L2;

          ^
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:76:10: error: no match for 'operator=' (operand types are 'Nod' and 'Nod*')
         q=L1;

          ^
lsiinterclasare.cpp:76: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:78:13: error: no match for 'operator&&' (operand types are 'Nod' and 'Nod')
     while(p && q)

             ^
lsiinterclasare.cpp:78:13: note: candidates are:
lsiinterclasare.cpp:78:13: note: operator&&(bool, bool) <built-in>
lsiinterclasare.cpp:78: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:78: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:78: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:78: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:78: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:78: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:78: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:78: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:78:16: note:   'Nod' is not derived from 'const std::valarray<_Tp>'
     while(p && q)

                ^
lsiinterclasare.cpp:80:13: error: base operand of '->' has non-pointer type 'Nod'
      while(p->leg && p->leg->info <=q->info)

             ^
lsiinterclasare.cpp:80:23: error: base operand of '->' has non-pointer type 'Nod'
      while(p->leg && p->leg->info <=q->info)

                       ^
lsiinterclasare.cpp:80:38: error: base operand of '->' has non-pointer type 'Nod'
      while(p->leg && p->leg->info <=q->info)

                                      ^
lsiinterclasare.cpp:81:14: error: base operand of '->' has non-pointer type 'Nod'
           p=p->leg;

              ^
lsiinterclasare.cpp:82:12: error: base operand of '->' has non-pointer type 'Nod'
       aux=p->leg;

            ^
lsiinterclasare.cpp:83:8: error: base operand of '->' has non-pointer type 'Nod'
       p->leg=q;

        ^

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 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:

  • Soluția propusă de tine este inclusă în programul suport, apoi acesta este compilat. Dacă în urma compilării se obțin erori sau avertismente, acestea sunt afișate în această pagină.
  • Datorită existenței programului suport, la compilare pot să apară erori sau avertismente care să nu se refere la instrucțiunile scrise de tine, dar care sunt datorate faptului că soluția ta nu este corectă.
  • Dacă programul suport 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ă.