#551
La liceul nostru sunt m clase, fiecare având n elevi. Pentru fiecare elev se cunoaşte talentul artistic, exprimat printr-un număr natural. Să se determine cea mai mare valoare pe care o are talentul artistic al elevilor, notată cu MAX şi numărul CNT de clase din liceu în care există elevi care au talent maxim.
| Problema | Elevi | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64890949 | Utilizator | |
| Fișier | elevi.cpp | Dimensiune | 475 B |
| Data încărcării | 09 Iunie 2026, 21:43 | Scor/rezultat | Eroare de compilare |
elevi.cpp:12:6: error: extended character « is not valid in an identifier 12 | cout « v[i] « " "; | ^ elevi.cpp:12:13: error: extended character « is not valid in an identifier 12 | cout « v[i] « " "; | ^ elevi.cpp:17:20: error: extended character › is not valid in an identifier 17 | {for (int j = n; j ›= i; j--) | ^ elevi.cpp: In function ‘int main()’: elevi.cpp:7:6: error: no match for ‘operator>’ (operand types are ‘std::istream’ {aka ‘std::basic_istream<char>’} and ‘int’) 7 | cin > n; | ~~~ ^ ~ | | | | | int | std::istream {aka std::basic_istream<char>} elevi.cpp:7:6: note: candidate: ‘operator>(int, int)’ (built-in) 7 | cin > n; | ~~~~^~~ elevi.cpp:7:6: note: no known conversion for argument 1 from ‘std::istream’ {aka ‘std::basic_istream<char>’} to ‘int’ In file included from /usr/include/c++/13/string:48, 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 elevi.cpp:1: /usr/include/c++/13/bits/stl_iterator.h:469:5: note: candidate: ‘template<class _Iterator> bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)’ 469 | operator>(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/13/bits/stl_iterator.h:469:5: note: template argument deduction/substitution failed: elevi.cpp:7:8: note: ‘std::istream’ {aka ‘std::basic_istream<char>’} is not derived from ‘const std::reverse_iterator<_Iterator>’ 7 | cin > n; | ^ /usr/include/c++/13/bits/stl_iterator.h:514:5: note: candidate: ‘template<class _IteratorL, class _IteratorR> bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)’ 514 | operator>(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/13/bits/stl_iterator.h:514:5: note: template argument deduction/substitution failed: elevi.cpp:7:8: note: ‘std::istream’ {aka ‘std::basic_istream<char>’} is not derived from ‘const std::reverse_iterator<_Iterator>’ 7 | cin > n; | ^ /usr/include/c++/13/bits/stl_iterator.h:1725:5: note: candidate: ‘template<class _IteratorL, class _IteratorR> bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)’ 1725 | operator>(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/13/bits/stl_iterator.h:1725:5: note: template argument deduction/substitution failed: elevi.cpp:7:8: note: ‘std::istream’ {aka ‘std::basic_istream<char>’} is not derived from ‘const std::move_iterator<_IteratorL>’ 7 | cin > n; | ^ /usr/include/c++/13/bits/stl_iterator.h:1784:5: note: candidate: ‘template<class _Iterator> bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)’ 1784 | operator>(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/13/bits/stl_iterator.h:1784:5: note: template argument deduction/substitution failed: elevi.cpp:7:8: note: ‘std::istream’ {aka ‘std::basic_istream<char>’} is not derived from ‘const std::move_iterator<_IteratorL>’ 7 | cin > n; | ^ In file included from /usr/include/c++/13/bits/stl_algobase.h:64, from /usr/include/c++/13/string:51: /usr/include/c++/13/bits/stl_pair.h:848:5: note: candidate: ‘template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)’ 848 | operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/13/bits/stl_pair.h:848:5: note: template argument deduction/substitution failed: elevi.cpp:7:8: note: ‘std::istream’ {aka ‘std::basic_istream<char>’} is not derived from ‘const std::pair<_T1, _T2>’ 7 | cin > n; | ^ In file included from /usr/include/c++/13/string:54: /usr/include/c++/13/bits/basic_string.h:3870:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)’ 3870 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/13/bits/basic_string.h:3870:5: note: template argument deduction/substitution failed: elevi.cpp:7:8: note: ‘std::istream’ {aka ‘std::basic_istream<char>’} is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’ 7 | cin > n; | ^ /usr/include/c++/13/bits/basic_string.h:3884:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)’ 3884 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/13/bits/basic_string.h:3884:5: note: template argument deduction/substitution failed: elevi.cpp:7:8: note: ‘std::istream’ {aka ‘std::basic_istream<char>’} is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’ 7 | cin > n; | ^ /usr/include/c++/13/bits/basic_string.h:3897:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)’ 3897 | operator>(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/13/bits/basic_string.h:3897:5: note: template argument deduction/substitution failed: elevi.cpp:7:8: note: mismatched types ‘const _CharT*’ and ‘std::basic_istream<char>’ 7 | cin > n; | ^ elevi.cpp:9:5: error: no match for ‘operator>’ (operand types are ‘std::istream’ {aka ‘std::basic_istream<char>’} and ‘long long int’) 9 | cin > v[i]; | ~~~ ^ ~~~~ | | | | | long long int | std::istream {aka std::basic_istream<char>} elevi.cpp:9:5: note: candidate: ‘operator>(int, long long int)’ (built-in) 9 | cin > v[i]; | ~~~~^~~~~~ elevi.cpp:9:5: note: no known conversion for argument 1 from ‘std::istream’ {aka ‘std::basic_istream<char>’} to ‘int’ /usr/include/c++/13/bits/stl_iterator.h:469:5: note: candidate: ‘template<class _Iterator> bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)’ 469 | operator>(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/13/bits/stl_iterator.h:469:5: note: template argument deduction/substitution failed: elevi.cpp:9:10: note: ‘std::istream’ {aka ‘std::basic_istream<char>’} is not derived from ‘const std::reverse_iterator<_Iterator>’ 9 | cin > v[i]; | ^ /usr/include/c++/13/bits/stl_iterator.h:514:5: note: candidate: ‘template<class _IteratorL, class _IteratorR> bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)’ 514 | operator>(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/13/bits/stl_iterator.h:514:5: note: template argument deduction/substitution failed: elevi.cpp:9:10: note: ‘std::istream’ {aka ‘std::basic_istream<char>’} is not derived from ‘const std::reverse_iterator<_Iterator>’ 9 | cin > v[i]; | ^ /usr/include/c++/13/bits/stl_iterator.h:1725:5: note: candidate: ‘template<class _IteratorL, class _IteratorR> bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)’ 1725 | operator>(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/13/bits/stl_iterator.h:1725:5: note: template argument deduction/substitution failed: elevi.cpp:9:10: note: ‘std::istream’ {aka ‘std::basic_istream<char>’} is not derived from ‘const std::move_iterator<_IteratorL>’ 9 | cin > v[i]; | ^ /usr/include/c++/13/bits/stl_iterator.h:1784:5: note: candidate: ‘template<class _Iterator> bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)’ 1784 | operator>(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/13/bits/stl_iterator.h:1784:5: note: template argument deduction/substitution failed: elevi.cpp:9:10: note: ‘std::istream’ {aka ‘std::basic_istream<char>’} is not derived from ‘const std::move_iterator<_IteratorL>’ 9 | cin > v[i]; | ^ /usr/include/c++/13/bits/stl_pair.h:848:5: note: candidate: ‘template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)’ 848 | operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/13/bits/stl_pair.h:848:5: note: template argument deduction/substitution failed: elevi.cpp:9:10: note: ‘std::istream’ {aka ‘std::basic_istream<char>’} is not derived from ‘const std::pair<_T1, _T2>’ 9 | cin > v[i]; | ^ /usr/include/c++/13/bits/basic_string.h:3870:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)’ 3870 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/13/bits/basic_string.h:3870:5: note: template argument deduction/substitution failed: elevi.cpp:9:10: note: ‘std::istream’ {aka ‘std::basic_istream<char>’} is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’ 9 | cin > v[i]; | ^ /usr/include/c++/13/bits/basic_string.h:3884:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)’ 3884 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/13/bits/basic_string.h:3884:5: note: template argument deduction/substitution failed: elevi.cpp:9:10: note: ‘std::istream’ {aka ‘std::basic_istream<char>’} is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’ 9 | cin > v[i]; | ^ /usr/include/c++/13/bits/basic_string.h:3897:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)’ 3897 | operator>(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/13/bits/basic_string.h:3897:5: note: template argument deduction/substitution failed: elevi.cpp:9:10: note: mismatched types ‘const _CharT*’ and ‘std::basic_istream<char>’ 9 | cin > v[i]; | ^ elevi.cpp:12:5: error: expected ‘;’ before ‘«’ 12 | cout « v[i] « " "; | ^~ | ; elevi.cpp:12:1: warning: statement has no effect [-Wunused-value] 12 | cout « v[i] « " "; | ^~~~ elevi.cpp:16:23: error: lvalue required as left operand of assignment 16 | if ((v[i - 1] + v[i]) % 2 = 0 8& v[i - 1] |= v[i]) | ~~~~~~~~~~~~~~~~~~^~~ elevi.cpp:16:30: error: expected ‘)’ before numeric constant 16 | if ((v[i - 1] + v[i]) % 2 = 0 8& v[i - 1] |= v[i]) | ~ ^~ | ) elevi.cpp:17:19: error: expected ‘;’ before ‘›’ 17 | {for (int j = n; j ›= i; j--) | ^~ | ; elevi.cpp:17:20: error: ‘›’ was not declared in this scope 17 | {for (int j = n; j ›= i; j--) | ^ elevi.cpp:17:24: error: expected ‘)’ before ‘;’ token 17 | {for (int j = n; j ›= i; j--) | ~ ^ | ) elevi.cpp:17:26: error: ‘j’ was not declared in this scope 17 | {for (int j = n; j ›= i; j--) | ^ elevi.cpp:20:3: error: expected primary-expression before ‘;’ token 20 | n*; | ^ elevi.cpp:25:12: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 25 | while (adv = 1); | ~~~~^~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Elevi 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ă.