Detalii evaluare #64160603

Rezumat problemă

#3187

Se dau două numere n p și o listă de n elemente cu urcările în autobuz a mai multor persoane a căror structura este prenume nume bilet_platit, fiecare intrare fiind plasată pe câte o linie. Câmpurile prenume și nume sunt șiruri de caractere, iar bilet_platit este un număr care poate fi 0 sau 1; 0 dacă persoana respectivă nu a plătit biletul sau 1 dacă a plătit biletul. Pentru fiecare bilet neplătit se va contoriza o penalizare persoanei.

Se cere :

a) Prenumele, numele și numărul de penalizări al persoanei care are număr maxim de penalizări. Dacă există mai multe persoane cu număr maxim de penalizări se cere afișarea persoanei care apare prima în ordine alfabetică.
b) Ordonarea listei de persoane descrescător după numărul de penalizări, la număr de penalizări egale, crescător după prenume, la prenume identice, crescător după nume.

Detalii

Problema RATC2 Operații I/O ratc2.in/ratc2.out
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #64160603 Utilizator Dorofteese Luca-Stefan (Luca_Stefan_Dorofteese)
Fișier ratc2.cpp Dimensiune 1.35 KB
Data încărcării 21 Aprilie 2026, 08:46 Scor/rezultat Eroare de compilare

Evaluare

Mesaj compilare

In file included from /usr/include/c++/13/bits/stl_algobase.h:64,
                 from /usr/include/c++/13/string:51,
                 from /usr/include/c++/13/bits/locale_classes.h:40,
                 from /usr/include/c++/13/bits/ios_base.h:41,
                 from /usr/include/c++/13/ios:44,
                 from /usr/include/c++/13/ostream:40,
                 from /usr/include/c++/13/iostream:41,
                 from ratc2.cpp:1:
/usr/include/c++/13/bits/stl_pair.h: In instantiation of ‘constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&) [with _T1 = date; _T2 = int]’:
/usr/include/c++/13/bits/predefined_ops.h:45:23:   required from ‘bool __gnu_cxx::__ops::_Iter_less_iter::operator()(_Iterator1, _Iterator2) const [with _Iterator1 = std::pair<date, int>*; _Iterator2 = std::pair<date, int>*]’
/usr/include/c++/13/bits/stl_algo.h:1819:14:   required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = pair<date, int>*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
/usr/include/c++/13/bits/stl_algo.h:1859:25:   required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = pair<date, int>*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
/usr/include/c++/13/bits/stl_algo.h:1950:31:   required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = pair<date, int>*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
/usr/include/c++/13/bits/stl_algo.h:4861:18:   required from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = pair<date, int>*]’
ratc2.cpp:48:13:   required from here
/usr/include/c++/13/bits/stl_pair.h:836:24: error: no match for ‘operator<’ (operand types are ‘const date’ and ‘const date’)
  836 |     { return __x.first < __y.first
      |              ~~~~~~~~~~^~~~~~~~~~~
ratc2.cpp:22:10: note: candidate: ‘bool date::operator<(const date&)’ (near match)
   22 |     bool operator < (const date& ot)
      |          ^~~~~~~~
ratc2.cpp:22:10: note:   passing ‘const date*’ as ‘this’ argument discards qualifiers
In file included from /usr/include/c++/13/string:48:
/usr/include/c++/13/bits/stl_iterator.h:455:5: note: candidate: ‘template<class _Iterator> bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)’
  455 |     operator<(const reverse_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:455:5: note:   template argument deduction/substitution failed:
/usr/include/c++/13/bits/stl_pair.h:836:24: note:   ‘const date’ is not derived from ‘const std::reverse_iterator<_Iterator>’
  836 |     { return __x.first < __y.first
      |              ~~~~~~~~~~^~~~~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:500:5: note: candidate: ‘template<class _IteratorL, class _IteratorR> bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)’
  500 |     operator<(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:500:5: note:   template argument deduction/substitution failed:
/usr/include/c++/13/bits/stl_pair.h:836:24: note:   ‘const date’ is not derived from ‘const std::reverse_iterator<_Iterator>’
  836 |     { return __x.first < __y.first
      |              ~~~~~~~~~~^~~~~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:1705:5: note: candidate: ‘template<class _IteratorL, class _IteratorR> bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)’
 1705 |     operator<(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:1705:5: note:   template argument deduction/substitution failed:
/usr/include/c++/13/bits/stl_pair.h:836:24: note:   ‘const date’ is not derived from ‘const std::move_iterator<_IteratorL>’
  836 |     { return __x.first < __y.first
      |              ~~~~~~~~~~^~~~~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:1770:5: note: candidate: ‘template<class _Iterator> bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)’
 1770 |     operator<(const move_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:1770:5: note:   template argument deduction/substitution failed:
/usr/include/c++/13/bits/stl_pair.h:836:24: note:   ‘const date’ is not derived from ‘const std::move_iterator<_IteratorL>’
  836 |     { return __x.first < __y.first
      |              ~~~~~~~~~~^~~~~~~~~~~
/usr/include/c++/13/bits/stl_pair.h:835:5: note: candidate: ‘template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)’
  835 |     operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
      |     ^~~~~~~~
/usr/include/c++/13/bits/stl_pair.h:835:5: note:   template argument deduction/substitution failed:
/usr/include/c++/13/bits/stl_pair.h:836:24: note:   ‘const date’ is not derived from ‘const std::pair<_T1, _T2>’
  836 |     { return __x.first < __y.first
      |              ~~~~~~~~~~^~~~~~~~~~~
/usr/include/c++/13/bits/stl_pair.h:837:30: error: no match for ‘operator<’ (operand types are ‘const date’ and ‘const date’)
  837 |              || (!(__y.first < __x.first) && __x.second < __y.second); }
      |                   ~~~~~~~~~~~^~~~~~~~~~~~
ratc2.cpp:22:10: note: candidate: ‘bool date::operator<(const date&)’ (near match)
   22 |     bool operator < (const date& ot)
      |          ^~~~~~~~
ratc2.cpp:22:10: note:   passing ‘const date*’ as ‘this’ argument discards qualifiers
/usr/include/c++/13/bits/stl_iterator.h:455:5: note: candidate: ‘template<class _Iterator> bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)’
  455 |     operator<(const reverse_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:455:5: note:   template argument deduction/substitution failed:
/usr/include/c++/13/bits/stl_pair.h:837:30: note:   ‘const date’ is not derived from ‘const std::reverse_iterator<_Iterator>’
  837 |              || (!(__y.first < __x.first) && __x.second < __y.second); }
      |                   ~~~~~~~~~~~^~~~~~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:500:5: note: candidate: ‘template<class _IteratorL, class _IteratorR> bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)’
  500 |     operator<(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:500:5: note:   template argument deduction/substitution failed:
/usr/include/c++/13/bits/stl_pair.h:837:30: note:   ‘const date’ is not derived from ‘const std::reverse_iterator<_Iterator>’
  837 |              || (!(__y.first < __x.first) && __x.second < __y.second); }
      |                   ~~~~~~~~~~~^~~~~~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:1705:5: note: candidate: ‘template<class _IteratorL, class _IteratorR> bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)’
 1705 |     operator<(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:1705:5: note:   template argument deduction/substitution failed:
/usr/include/c++/13/bits/stl_pair.h:837:30: note:   ‘const date’ is not derived from ‘const std::move_iterator<_IteratorL>’
  837 |              || (!(__y.first < __x.first) && __x.second < __y.second); }
      |                   ~~~~~~~~~~~^~~~~~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:1770:5: note: candidate: ‘template<class _Iterator> bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)’
 1770 |     operator<(const move_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:1770:5: note:   template argument deduction/substitution failed:
/usr/include/c++/13/bits/stl_pair.h:837:30: note:   ‘const date’ is not derived from ‘const std::move_iterator<_IteratorL>’
  837 |              || (!(__y.first < __x.first) && __x.second < __y.second); }
      |                   ~~~~~~~~~~~^~~~~~~~~~~~
/usr/include/c++/13/bits/stl_pair.h:835:5: note: candidate: ‘template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)’
  835 |     operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
      |     ^~~~~~~~
/usr/include/c++/13/bits/stl_pair.h:835:5: note:   template argument deduction/substitution failed:
/usr/include/c++/13/bits/stl_pair.h:837:30: note:   ‘const date’ is not derived from ‘const std::pair<_T1, _T2>’
  837 |              || (!(__y.first < __x.first) && __x.second < __y.second); }
      |                   ~~~~~~~~~~~^~~~~~~~~~~~

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

Du-te sus!