#3445
leftmax
În clasa lui Dexter sunt N
elevi de înălțimi distincte. La ora de sport, ei sunt așezați în linie, de la stânga la dreapta. Profesorul lor, Johnny, va selecta pentru un exercițiu elevi aflați pe poziții consecutive în linie, astfel încât cel mai înalt elev dintre cei selectați să se afle în prima jumătate a acestora.
De exemplu, dacă elevii au, în ordine, înălțimile 1
, 5
, 4
, atunci profesorul poate să îi selecteze pe cei cu înălțimile 5
și 4
, dar nu poate să îi selecteze pe cei cu înălțimile 1
și 5
. Desigur, există mai multe moduri de a selecta elevii astfel încât să fie satisfăcută condiția de mai sus. Profesorul Johnny ar vrea să afle în câte moduri se poate face acest lucru.
Dându-se N
și înălțimile elevilor din clasă, aflați în câte moduri pot fi selectați oricâți elevi aflați pe poziții consecutive, astfel încât să fie îndeplinită condiția din enunț.
Problema | leftmax | Operații I/O |
![]() leftmax.in /leftmax.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 16 MB
|
Id soluție | #56748302 | Utilizator | |
Fișier | leftmax.cpp | Dimensiune | 1.23 KB |
Data încărcării | 04 Martie 2025, 16:37 | Scor / rezultat | Eroare de compilare |
leftmax.cpp: In function 'int main()': leftmax.cpp:34:20: error: no match for 'operator>' (operand types are 'f' and 'f') if(v[j]>v[i]) { ^ leftmax.cpp:34:20: note: candidates are: In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from leftmax.cpp:9: /usr/include/c++/4.8/bits/stl_pair.h:233: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:233:5: note: template argument deduction/substitution failed: leftmax.cpp:34:24: note: 'f' is not derived from 'const std::pair<_T1, _T2>' if(v[j]>v[i]) { ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from leftmax.cpp:9: /usr/include/c++/4.8/bits/stl_iterator.h:309: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:309:5: note: template argument deduction/substitution failed: leftmax.cpp:34:24: note: 'f' is not derived from 'const std::reverse_iterator<_Iterator>' if(v[j]>v[i]) { ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from leftmax.cpp:9: /usr/include/c++/4.8/bits/stl_iterator.h:359: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:359:5: note: template argument deduction/substitution failed: leftmax.cpp:34:24: note: 'f' is not derived from 'const std::reverse_iterator<_Iterator>' if(v[j]>v[i]) { ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from leftmax.cpp:9: /usr/include/c++/4.8/bits/stl_iterator.h:1079: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:1079:5: note: template argument deduction/substitution failed: leftmax.cpp:34:24: note: 'f' is not derived from 'const std::move_iterator<_Iterator>' if(v[j]>v[i]) { ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from leftmax.cpp:9: /usr/include/c++/4.8/bits/stl_iterator.h:1085: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:1085:5: note: template argument deduction/substitution failed: leftmax.cpp:34:24: note: 'f' is not derived from 'const std::move_iterator<_Iterator>' if(v[j]>v[i]) { ^ In file included from /usr/include/c++/4.8/string:52:0, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from leftmax.cpp:9: /usr/include/c++/4.8/bits/basic_string.h:2606: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:2606:5: note: template argument deduction/substitution failed: leftmax.cpp:34:24: note: 'f' is not derived from 'const std::basic_string<_CharT, _Traits, _Alloc>' if(v[j]>v[i]) { ^ In file included from /usr/include/c++/4.8/string:52:0, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from leftmax.cpp:9: /usr/include/c++/4.8/bits/basic_string.h:2618: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:2618:5: note: template argument deduction/substitution failed: leftmax.cpp:34:24: note: 'f' is not derived from 'const std::basic_string<_CharT, _Traits, _Alloc>' if(v[j]>v[i]) { ^ In file included from /usr/include/c++/4.8/string:52:0, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from leftmax.cpp:9: /usr/include/c++/4.8/bits/basic_string.h:2630: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:2630:5: note: template argument deduction/substitution failed: leftmax.cpp:34:24: note: mismatched types 'const _CharT*' and 'f' if(v[j]>v[i]) { ^ In file included from /usr/include/c++/4.8/deque:64:0, from /usr/include/c++/4.8/queue:60, from leftmax.cpp:10: /usr/include/c++/4.8/bits/stl_deque.h:288:5: note: template<class _Tp, class _Ref, class _Ptr> bool std::operator>(const std::_Deque_iterator<_Tp, _Ref, _Ptr>&, const std::_Deque_iterator<_Tp, _Ref, _Ptr>&) operator>(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x, ^ /usr/include/c++/4.8/bits/stl_deque.h:288:5: note: template argument deduction/substitution failed: leftmax.cpp:34:24: note: 'f' is not derived from 'const std::_Deque_iterator<_Tp, _Ref, _Ptr>' if(v[j]>v[i]) { ^ In file included from /usr/include/c++/4.8/deque:64:0, from /usr/include/c++/4.8/queue:60, from leftmax.cpp:10: /usr/include/c++/4.8/bits/stl_deque.h:295:5: note: template<class _Tp, class _RefL, class _PtrL, class _RefR, class _PtrR> bool std::operator>(const std::_Deque_iterator<_Tp, _Ref, _Ptr>&, const std::_Deque_iterator<_Tp, _RefR, _PtrR>&) operator>(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x, ^ /usr/include/c++/4.8/bits/stl_deque.h:295:5: note: template argument deduction/substitution failed: leftmax.cpp:34:24: note: 'f' is not derived from 'const std::_Deque_iterator<_Tp, _Ref, _Ptr>' if(v[j]>v[i]) { ^ In file included from /usr/include/c++/4.8/deque:64:0, from /usr/include/c++/4.8/queue:60, from leftmax.cpp:10: /usr/include/c++/4.8/bits/stl_deque.h:1990:5: note: template<class _Tp, class _Alloc> bool std::operator>(const std::deque<_Tp, _Alloc>&, const std::deque<_Tp, _Alloc>&) operator>(const deque<_Tp, _Alloc>& __x, ^ /usr/include/c++/4.8/bits/stl_deque.h:1990:5: note: template argument deduction/substitution failed: leftmax.cpp:34:24: note: 'f' is not derived from 'const std::deque<_Tp, _Alloc>' if(v[j]>v[i]) { ^ In file included from /usr/include/c++/4.8/vector:64:0, from /usr/include/c++/4.8/queue:61, from leftmax.cpp:10: /usr/include/c++/4.8/bits/stl_vector.h:1434: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:1434:5: note: template argument deduction/substitution failed: leftmax.cpp:34:24: note: 'f' is not derived from 'const std::vector<_Tp, _Alloc>' if(v[j]>v[i]) { ^ In file included from /usr/include/c++/4.8/queue:64:0, from leftmax.cpp:10: /usr/include/c++/4.8/bits/stl_queue.h:298:5: note: template<class _Tp, class _Seq> bool std::operator>(const std::queue<_Tp, _Seq>&, const std::queue<_Tp, _Seq>&) operator>(const queue<_Tp, _Seq>& __x, const queue<_Tp, _Seq>& __y) ^ /usr/include/c++/4.8/bits/stl_queue.h:298:5: note: template argument deduction/substitution failed: leftmax.cpp:34:24: note: 'f' is not derived from 'const std::queue<_Tp, _Seq>' if(v[j]>v[i]) { ^ 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 leftmax.cpp:13: /usr/include/c++/4.8/array:246: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>& __one, const array<_Tp, _Nm>& __two) ^ /usr/include/c++/4.8/array:246:5: note: template argument deduction/substitution failed: leftmax.cpp:34:24: note: 'f' is not derived from 'const std::array<_Tp, _Nm>' if(v[j]>v[i]) { ^ 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 leftmax.cpp:13: /usr/include/c++/4.8/tuple:841: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:841:5: note: template argument deduction/substitution failed: leftmax.cpp:34:24: note: 'f' is not derived from 'const std::tuple<_Elements ...>' if(v[j]>v[i]) { ^ leftmax.cpp:41:20: error: no match for 'operator>' (operand types are 'f' and 'f') if(v[j]>v[i]){ ^ leftmax.cpp:41:20: note: candidates are: In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from leftmax.cpp:9: /usr/include/c++/4.8/bits/stl_pair.h:233: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:233:5: note: template argument deduction/substitution failed: leftmax.cpp:41:24: note: 'f' is not derived from 'const std::pair<_T1, _T2>' if(v[j]>v[i]){ ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from leftmax.cpp:9: /usr/include/c++/4.8/bits/stl_iterator.h:309: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:309:5: note: template argument deduction/substitution failed: leftmax.cpp:41:24: note: 'f' is not derived from 'const std::reverse_iterator<_Iterator>' if(v[j]>v[i]){ ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from leftmax.cpp:9: /usr/include/c++/4.8/bits/stl_iterator.h:359: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:359:5: note: template argument deduction/substitution failed: leftmax.cpp:41:24: note: 'f' is not derived from 'const std::reverse_iterator<_Iterator>' if(v[j]>v[i]){ ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from leftmax.cpp:9: /usr/include/c++/4.8/bits/stl_iterator.h:1079: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:1079:5: note: template argument deduction/substitution failed: leftmax.cpp:41:24: note: 'f' is not derived from 'const std::move_iterator<_Iterator>' if(v[j]>v[i]){ ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from leftmax.cpp:9: /usr/include/c++/4.8/bits/stl_iterator.h:1085: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:1085:5: note: template argument deduction/substitution failed: leftmax.cpp:41:24: note: 'f' is not derived from 'const std::move_iterator<_Iterator>' if(v[j]>v[i]){ ^ In file included from /usr/include/c++/4.8/string:52:0, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from leftmax.cpp:9: /usr/include/c++/4.8/bits/basic_string.h:2606: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:2606:5: note: template argument deduction/substitution failed: leftmax.cpp:41:24: note: 'f' is not derived from 'const std::basic_string<_CharT, _Traits, _Alloc>' if(v[j]>v[i]){ ^ In file included from /usr/include/c++/4.8/string:52:0, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from leftmax.cpp:9: /usr/include/c++/4.8/bits/basic_string.h:2618: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:2618:5: note: template argument deduction/substitution failed: leftmax.cpp:41:24: note: 'f' is not derived from 'const std::basic_string<_CharT, _Traits, _Alloc>' if(v[j]>v[i]){ ^ In file included from /usr/include/c++/4.8/string:52:0, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from leftmax.cpp:9: /usr/include/c++/4.8/bits/basic_string.h:2630: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:2630:5: note: template argument deduction/substitution failed: leftmax.cpp:41:24: note: mismatched types 'const _CharT*' and 'f' if(v[j]>v[i]){ ^ In file included from /usr/include/c++/4.8/deque:64:0, from /usr/include/c++/4.8/queue:60, from leftmax.cpp:10: /usr/include/c++/4.8/bits/stl_deque.h:288:5: note: template<class _Tp, class _Ref, class _Ptr> bool std::operator>(const std::_Deque_iterator<_Tp, _Ref, _Ptr>&, const std::_Deque_iterator<_Tp, _Ref, _Ptr>&) operator>(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x, ^ /usr/include/c++/4.8/bits/stl_deque.h:288:5: note: template argument deduction/substitution failed: leftmax.cpp:41:24: note: 'f' is not derived from 'const std::_Deque_iterator<_Tp, _Ref, _Ptr>' if(v[j]>v[i]){ ^ In file included from /usr/include/c++/4.8/deque:64:0, from /usr/include/c++/4.8/queue:60, from leftmax.cpp:10: /usr/include/c++/4.8/bits/stl_deque.h:295:5: note: template<class _Tp, class _RefL, class _PtrL, class _RefR, class _PtrR> bool std::operator>(const std::_Deque_iterator<_Tp, _Ref, _Ptr>&, const std::_Deque_iterator<_Tp, _RefR, _PtrR>&) operator>(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x, ^ /usr/include/c++/4.8/bits/stl_deque.h:295:5: note: template argument deduction/substitution failed: leftmax.cpp:41:24: note: 'f' is not derived from 'const std::_Deque_iterator<_Tp, _Ref, _Ptr>' if(v[j]>v[i]){ ^ In file included from /usr/include/c++/4.8/deque:64:0, from /usr/include/c++/4.8/queue:60, from leftmax.cpp:10: /usr/include/c++/4.8/bits/stl_deque.h:1990:5: note: template<class _Tp, class _Alloc> bool std::operator>(const std::deque<_Tp, _Alloc>&, const std::deque<_Tp, _Alloc>&) operator>(const deque<_Tp, _Alloc>& __x, ^ /usr/include/c++/4.8/bits/stl_deque.h:1990:5: note: template argument deduction/substitution failed: leftmax.cpp:41:24: note: 'f' is not derived from 'const std::deque<_Tp, _Alloc>' if(v[j]>v[i]){ ^ In file included from /usr/include/c++/4.8/vector:64:0, from /usr/include/c++/4.8/queue:61, from leftmax.cpp:10: /usr/include/c++/4.8/bits/stl_vector.h:1434: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:1434:5: note: template argument deduction/substitution failed: leftmax.cpp:41:24: note: 'f' is not derived from 'const std::vector<_Tp, _Alloc>' if(v[j]>v[i]){ ^ In file included from /usr/include/c++/4.8/queue:64:0, from leftmax.cpp:10: /usr/include/c++/4.8/bits/stl_queue.h:298:5: note: template<class _Tp, class _Seq> bool std::operator>(const std::queue<_Tp, _Seq>&, const std::queue<_Tp, _Seq>&) operator>(const queue<_Tp, _Seq>& __x, const queue<_Tp, _Seq>& __y) ^ /usr/include/c++/4.8/bits/stl_queue.h:298:5: note: template argument deduction/substitution failed: leftmax.cpp:41:24: note: 'f' is not derived from 'const std::queue<_Tp, _Seq>' if(v[j]>v[i]){ ^ 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 leftmax.cpp:13: /usr/include/c++/4.8/array:246: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>& __one, const array<_Tp, _Nm>& __two) ^ /usr/include/c++/4.8/array:246:5: note: template argument deduction/substitution failed: leftmax.cpp:41:24: note: 'f' is not derived from 'const std::array<_Tp, _Nm>' if(v[j]>v[i]){ ^ 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 leftmax.cpp:13: /usr/include/c++/4.8/tuple:841: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:841:5: note: template argument deduction/substitution failed: leftmax.cpp:41:24: note: 'f' is not derived from 'const std::tuple<_Elements ...>' if(v[j]>v[i]){ ^ leftmax.cpp:50:20: error: 'x' was not declared in this scope if(v[i].p2-x<x-v[i].p1){ ^ leftmax.cpp:49:13: warning: unused variable 'd' [-Wunused-variable] int d=(v[i].p2-i+1)*(v[i].p2-i)/2; ^ leftmax.cpp:27:15: warning: unused variable 's' [-Wunused-variable] long long s=0; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema leftmax face parte din prima categorie. 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ă.