Detalii evaluare #50675811

Rezumat problemă

#4125 schi1

Ultimul sezon rece a fost unul cu multa zăpadă căzută în zona montană, prin urmare magazinul de articole sportive din stațiunea de schi Semenic a avut vânzări mari, mai ales de clăpari (bocanci speciali pentru schiat). Acum fiind sfârșit de sezon, angajații magazinului constată că le-au rămas N cutii goale în care au fost ambalate perechile de clăpari vândute. Aceste cutii au forma unui paralelipiped dreptunghic la care fața superioară constituie capacul. Cunoscând N (numărul de cutii din magazin), ordinea în care cutiile sunt așezate în turn, iar pentru fiecare cutie latura capacului, înălțimea cutiei și dacă are capac sau, în cazul în care capacul lipsește, dacă cutia este așezată cu golul în sus sau cu golul în jos determinați:

  • înălțimea turnului astfel format;
  • numărul de cutii ale căror fețe laterale sunt vizibile dacă se privește turnul din lateral.

ONI 2022, clasa a IX-a

Detalii

Problema schi1 Operații I/O schi.in/schi.out
Limita timp 0.3 secunde Limita memorie Total: 512 MB / Stivă 8 MB
Id soluție #50675811 Utilizator Popa Rares (rares0401)
Fișier schi1.cpp Dimensiune 3.67 KB
Data încărcării 19 Aprilie 2024, 21:34 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

schi1.cpp: In function 'int main()':
schi1.cpp:41:99: error: no matching function for call to 'max(int&, long long int)'
                         inaltimi[i]=max(inaltimi[i],inaltimi[cutieSus.index]-cutieSus.h+cutii[i].h);

                                                                                                   ^
schi1.cpp:41:99: note: candidates are:
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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from schi1.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)
     max(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:216:5: note:   template argument deduction/substitution failed:
schi1.cpp:41:99: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
                         inaltimi[i]=max(inaltimi[i],inaltimi[cutieSus.index]-cutieSus.h+cutii[i].h);

                                                                                                   ^
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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from schi1.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:260:5: note:   template argument deduction/substitution failed:
schi1.cpp:41:99: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
                         inaltimi[i]=max(inaltimi[i],inaltimi[cutieSus.index]-cutieSus.h+cutii[i].h);

                                                                                                   ^
schi1.cpp:43:88: error: no matching function for call to 'max(int&, long long int)'
                         inaltimi[i]=max(inaltimi[i],inaltimi[cutieSus.index]+cutii[i].h);

                                                                                        ^
schi1.cpp:43:88: note: candidates are:
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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from schi1.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)
     max(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:216:5: note:   template argument deduction/substitution failed:
schi1.cpp:43:88: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
                         inaltimi[i]=max(inaltimi[i],inaltimi[cutieSus.index]+cutii[i].h);

                                                                                        ^
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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from schi1.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:260:5: note:   template argument deduction/substitution failed:
schi1.cpp:43:88: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
                         inaltimi[i]=max(inaltimi[i],inaltimi[cutieSus.index]+cutii[i].h);

                                                                                        ^
schi1.cpp:46:84: error: no matching function for call to 'max(int&, long long int)'
                     inaltimi[i]=max(inaltimi[i],inaltimi[cutieSus.index]+cutii[i].h);

                                                                                    ^
schi1.cpp:46:84: note: candidates are:
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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from schi1.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)
     max(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:216:5: note:   template argument deduction/substitution failed:
schi1.cpp:46:84: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
                     inaltimi[i]=max(inaltimi[i],inaltimi[cutieSus.index]+cutii[i].h);

                                                                                    ^
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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from schi1.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:260:5: note:   template argument deduction/substitution failed:
schi1.cpp:46:84: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
                     inaltimi[i]=max(inaltimi[i],inaltimi[cutieSus.index]+cutii[i].h);

                                                                                    ^
schi1.cpp:52:99: error: no matching function for call to 'max(int&, long long int)'
                         inaltimi[i]=max(inaltimi[i],inaltimi[cutieSus.index]-cutieSus.h+cutii[i].h);

                                                                                                   ^
schi1.cpp:52:99: note: candidates are:
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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from schi1.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)
     max(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:216:5: note:   template argument deduction/substitution failed:
schi1.cpp:52:99: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
                         inaltimi[i]=max(inaltimi[i],inaltimi[cutieSus.index]-cutieSus.h+cutii[i].h);

                                                                                                   ^
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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from schi1.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:260:5: note:   template argument deduction/substitution failed:
schi1.cpp:52:99: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
                         inaltimi[i]=max(inaltimi[i],inaltimi[cutieSus.index]-cutieSus.h+cutii[i].h);

                                                                                                   ^
schi1.cpp:61:88: error: no matching function for call to 'max(int&, long long int)'
                         inaltimi[i]=max(inaltimi[i],inaltimi[cutieSus.index]+cutii[i].h);

                                                                                        ^
schi1.cpp:61:88: note: candidates are:
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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from schi1.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)
     max(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:216:5: note:   template argument deduction/substitution failed:
schi1.cpp:61:88: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
                         inaltimi[i]=max(inaltimi[i],inaltimi[cutieSus.index]+cutii[i].h);

                                                                                        ^
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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from schi1.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:260:5: note:   template argument deduction/substitution failed:
schi1.cpp:61:88: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
                         inaltimi[i]=max(inaltimi[i],inaltimi[cutieSus.index]+cutii[i].h);

                                                                                        ^
schi1.cpp:76:38: error: no matching function for call to 'max(long long int&, int&)'
             maxx=max(maxx,inaltimi[i]);

                                      ^
schi1.cpp:76:38: note: candidates are:
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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from schi1.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)
     max(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:216:5: note:   template argument deduction/substitution failed:
schi1.cpp:76:38: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
             maxx=max(maxx,inaltimi[i]);

                                      ^
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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from schi1.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:260:5: note:   template argument deduction/substitution failed:
schi1.cpp:76:38: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
             maxx=max(maxx,inaltimi[i]);

                                      ^

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