Detalii evaluare #15214552

Rezumat problemă

#2937 ora

Gigel este la ora de informatică, iar profesorul i-a dat o sarcină: să sorteze numele celor n colegi ai săi după o regulă specială. Fiecărui nume i se asociază un număr care iniţial este 0 și crește cu 1 pentru fiecare pereche de vocale consecutive și scade cu 1 pentru fiecare pereche de consoane consecutive Dacă perechea este formată dintr-o vocală și o consoană, numărul nu se modifică.

Dându-se cele n nume ale colegilor, să se sorteze crescător după numerele asociate. La numere egale, se vor sorta alfabetic.

Detalii

Problema ora Operații I/O tastatură/ecran
Limita timp 0.85 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #15214552 Utilizator Ciocîrlan Petru (petru_ciocirlan)
Fișier ora.cpp Dimensiune 875 B
Data încărcării 04 Aprilie 2019, 19:59 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_algo.h: In instantiation of '_RandomAccessIterator std::__unguarded_partition(_RandomAccessIterator, _RandomAccessIterator, const _Tp&) [with _RandomAccessIterator = name*; _Tp = name]':
/usr/include/c++/4.8/bits/stl_algo.h:2283:70:   required from '_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = name*]'
/usr/include/c++/4.8/bits/stl_algo.h:2315:54:   required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size) [with _RandomAccessIterator = name*; _Size = int]'
/usr/include/c++/4.8/bits/stl_algo.h:5461:36:   required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = name*]'
ora.cpp:40:32:   required from here
/usr/include/c++/4.8/bits/stl_algo.h:2242:20: error: no match for 'operator<' (operand types are 'name' and 'const name')
    while (*__first < __pivot)
                    ^
/usr/include/c++/4.8/bits/stl_algo.h:2242:20: note: candidates are:
In file included from /usr/include/c++/4.8/utility:70:0,
                 from /usr/include/c++/4.8/algorithm:60,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:220:5: note: template<class _T1, class _T2> constexpr bool std::operator<(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)
     operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
     ^
/usr/include/c++/4.8/bits/stl_pair.h:220:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_algo.h:2242:20: note:   'name' is not derived from 'const std::pair<_T1, _T2>'
    while (*__first < __pivot)
                    ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/4.8/algorithm:61,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_iterator.h:297:5: note: template<class _Iterator> bool std::operator<(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)
     operator<(const reverse_iterator<_Iterator>& __x,
     ^
/usr/include/c++/4.8/bits/stl_iterator.h:297:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_algo.h:2242:20: note:   'name' is not derived from 'const std::reverse_iterator<_Iterator>'
    while (*__first < __pivot)
                    ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/4.8/algorithm:61,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_iterator.h:347:5: note: template<class _IteratorL, class _IteratorR> bool std::operator<(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)
     operator<(const reverse_iterator<_IteratorL>& __x,
     ^
/usr/include/c++/4.8/bits/stl_iterator.h:347:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_algo.h:2242:20: note:   'name' is not derived from 'const std::reverse_iterator<_Iterator>'
    while (*__first < __pivot)
                    ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/4.8/algorithm:61,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_iterator.h:1055:5: note: template<class _IteratorL, class _IteratorR> bool std::operator<(const std::move_iterator<_Iterator>&, const std::move_iterator<_IteratorR>&)
     operator<(const move_iterator<_IteratorL>& __x,
     ^
/usr/include/c++/4.8/bits/stl_iterator.h:1055:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_algo.h:2242:20: note:   'name' is not derived from 'const std::move_iterator<_Iterator>'
    while (*__first < __pivot)
                    ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/4.8/algorithm:61,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_iterator.h:1061:5: note: template<class _Iterator> bool std::operator<(const std::move_iterator<_Iterator>&, const std::move_iterator<_Iterator>&)
     operator<(const move_iterator<_Iterator>& __x,
     ^
/usr/include/c++/4.8/bits/stl_iterator.h:1061:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_algo.h:2242:20: note:   'name' is not derived from 'const std::move_iterator<_Iterator>'
    while (*__first < __pivot)
                    ^
In file included from /usr/include/c++/4.8/string:52:0,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2569:5: note: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const std::basic_string<_CharT, _Traits, _Alloc>&, const std::basic_string<_CharT, _Traits, _Alloc>&)
     operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2569:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_algo.h:2242:20: note:   'name' is not derived from 'const std::basic_string<_CharT, _Traits, _Alloc>'
    while (*__first < __pivot)
                    ^
In file included from /usr/include/c++/4.8/string:52:0,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2581:5: note: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const std::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)
     operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2581:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_algo.h:2242:20: note:   'name' is not derived from 'const std::basic_string<_CharT, _Traits, _Alloc>'
    while (*__first < __pivot)
                    ^
In file included from /usr/include/c++/4.8/string:52:0,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2593:5: note: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const std::basic_string<_CharT, _Traits, _Alloc>&)
     operator<(const _CharT* __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2593:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_algo.h:2242:20: note:   mismatched types 'const _CharT*' and 'name'
    while (*__first < __pivot)
                    ^
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 ora.cpp:1:
/usr/include/c++/4.8/bits/stl_vector.h:1421:5: note: template<class _Tp, class _Alloc> bool std::operator<(const std::vector<_Tp, _Alloc>&, const std::vector<_Tp, _Alloc>&)
     operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
     ^
/usr/include/c++/4.8/bits/stl_vector.h:1421:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_algo.h:2242:20: note:   'name' is not derived from 'const std::vector<_Tp, _Alloc>'
    while (*__first < __pivot)
                    ^
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 ora.cpp:1:
/usr/include/c++/4.8/array:238:5: note: template<class _Tp, unsigned int _Nm> bool std::operator<(const std::array<_Tp, _Nm>&, const std::array<_Tp, _Nm>&)
     operator<(const array<_Tp, _Nm>& __a, const array<_Tp, _Nm>& __b)
     ^
/usr/include/c++/4.8/array:238:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_algo.h:2242:20: note:   'name' is not derived from 'const std::array<_Tp, _Nm>'
    while (*__first < __pivot)
                    ^
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 ora.cpp:1:
/usr/include/c++/4.8/tuple:824:5: note: template<class ... _TElements, class ... _UElements> constexpr bool std::operator<(const std::tuple<_Elements ...>&, const std::tuple<_Elements ...>&)
     operator<(const tuple<_TElements...>& __t,
     ^
/usr/include/c++/4.8/tuple:824:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_algo.h:2242:20: note:   'name' is not derived from 'const std::tuple<_Elements ...>'
    while (*__first < __pivot)
                    ^
ora.cpp:20:6: note: bool operator<(name&, name&)
 bool operator<(name &a, name &b)

      ^
ora.cpp:20:6: note:   no known conversion for argument 2 from 'const name' to 'name&'
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_algo.h:2245:19: error: no match for 'operator<' (operand types are 'const name' and 'name')
    while (__pivot < *__last)
                   ^
/usr/include/c++/4.8/bits/stl_algo.h:2245:19: note: candidates are:
In file included from /usr/include/c++/4.8/utility:70:0,
                 from /usr/include/c++/4.8/algorithm:60,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:220:5: note: template<class _T1, class _T2> constexpr bool std::operator<(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)
     operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
     ^
/usr/include/c++/4.8/bits/stl_pair.h:220:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_algo.h:2245:19: note:   'const name' is not derived from 'const std::pair<_T1, _T2>'
    while (__pivot < *__last)
                   ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/4.8/algorithm:61,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_iterator.h:297:5: note: template<class _Iterator> bool std::operator<(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)
     operator<(const reverse_iterator<_Iterator>& __x,
     ^
/usr/include/c++/4.8/bits/stl_iterator.h:297:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_algo.h:2245:19: note:   'const name' is not derived from 'const std::reverse_iterator<_Iterator>'
    while (__pivot < *__last)
                   ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/4.8/algorithm:61,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_iterator.h:347:5: note: template<class _IteratorL, class _IteratorR> bool std::operator<(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)
     operator<(const reverse_iterator<_IteratorL>& __x,
     ^
/usr/include/c++/4.8/bits/stl_iterator.h:347:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_algo.h:2245:19: note:   'const name' is not derived from 'const std::reverse_iterator<_Iterator>'
    while (__pivot < *__last)
                   ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/4.8/algorithm:61,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_iterator.h:1055:5: note: template<class _IteratorL, class _IteratorR> bool std::operator<(const std::move_iterator<_Iterator>&, const std::move_iterator<_IteratorR>&)
     operator<(const move_iterator<_IteratorL>& __x,
     ^
/usr/include/c++/4.8/bits/stl_iterator.h:1055:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_algo.h:2245:19: note:   'const name' is not derived from 'const std::move_iterator<_Iterator>'
    while (__pivot < *__last)
                   ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/4.8/algorithm:61,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_iterator.h:1061:5: note: template<class _Iterator> bool std::operator<(const std::move_iterator<_Iterator>&, const std::move_iterator<_Iterator>&)
     operator<(const move_iterator<_Iterator>& __x,
     ^
/usr/include/c++/4.8/bits/stl_iterator.h:1061:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_algo.h:2245:19: note:   'const name' is not derived from 'const std::move_iterator<_Iterator>'
    while (__pivot < *__last)
                   ^
In file included from /usr/include/c++/4.8/string:52:0,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2569:5: note: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const std::basic_string<_CharT, _Traits, _Alloc>&, const std::basic_string<_CharT, _Traits, _Alloc>&)
     operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2569:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_algo.h:2245:19: note:   'const name' is not derived from 'const std::basic_string<_CharT, _Traits, _Alloc>'
    while (__pivot < *__last)
                   ^
In file included from /usr/include/c++/4.8/string:52:0,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2581:5: note: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const std::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)
     operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2581:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_algo.h:2245:19: note:   'const name' is not derived from 'const std::basic_string<_CharT, _Traits, _Alloc>'
    while (__pivot < *__last)
                   ^
In file included from /usr/include/c++/4.8/string:52:0,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2593:5: note: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const std::basic_string<_CharT, _Traits, _Alloc>&)
     operator<(const _CharT* __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2593:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_algo.h:2245:19: note:   mismatched types 'const _CharT*' and 'name'
    while (__pivot < *__last)
                   ^
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 ora.cpp:1:
/usr/include/c++/4.8/bits/stl_vector.h:1421:5: note: template<class _Tp, class _Alloc> bool std::operator<(const std::vector<_Tp, _Alloc>&, const std::vector<_Tp, _Alloc>&)
     operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
     ^
/usr/include/c++/4.8/bits/stl_vector.h:1421:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_algo.h:2245:19: note:   'const name' is not derived from 'const std::vector<_Tp, _Alloc>'
    while (__pivot < *__last)
                   ^
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 ora.cpp:1:
/usr/include/c++/4.8/array:238:5: note: template<class _Tp, unsigned int _Nm> bool std::operator<(const std::array<_Tp, _Nm>&, const std::array<_Tp, _Nm>&)
     operator<(const array<_Tp, _Nm>& __a, const array<_Tp, _Nm>& __b)
     ^
/usr/include/c++/4.8/array:238:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_algo.h:2245:19: note:   'const name' is not derived from 'const std::array<_Tp, _Nm>'
    while (__pivot < *__last)
                   ^
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 ora.cpp:1:
/usr/include/c++/4.8/tuple:824:5: note: template<class ... _TElements, class ... _UElements> constexpr bool std::operator<(const std::tuple<_Elements ...>&, const std::tuple<_Elements ...>&)
     operator<(const tuple<_TElements...>& __t,
     ^
/usr/include/c++/4.8/tuple:824:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from ora.cpp:1:
/usr/include/c++/4.8/bits/stl_algo.h:2245:19: note:   'const name' is not derived from 'const std::tuple<_Elements ...>'
    while (__pivot < *__last)
                   ^
ora.cpp:20:6: note: bool operator<(name&, name&)
 bool operator<(name &a, name &b)

      ^
ora.cpp:20:6: note:   no known conversion for argument 1 from 'const name' to 'name&'

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