#1875
Se consideră un șir de cifre. Să se determine lungimea maximală a unei secvențe din șir formată din cifre egale.
| Problema | platou1 | Operații I/O |
platou1.in/platou1.out
|
|---|---|---|---|
| Limita timp | 0.01 secunde | Limita memorie |
Total: 0.5 MB
/
Stivă 0.5 MB
|
| Id soluție | #64237321 | Utilizator | |
| Fișier | platou1.cpp | Dimensiune | 426 B |
| Data încărcării | 24 Aprilie 2026, 15:01 | Scor/rezultat | Eroare de compilare |
platou1.cpp: In function ‘int main()’: platou1.cpp:7:6: error: no match for ‘operator>’ (operand types are ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} and ‘int’) 7 | fin> a; | ~~~^ ~ | | | | | int | std::ifstream {aka std::basic_ifstream<char>} platou1.cpp:7:6: note: candidate: ‘operator>(int, int)’ (built-in) 7 | fin> a; | ~~~^~~ platou1.cpp:7:6: note: no known conversion for argument 1 from ‘std::ifstream’ {aka ‘std::basic_ifstream<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/istream:40, from /usr/include/c++/13/fstream:40, from platou1.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: platou1.cpp:7:8: note: ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} is not derived from ‘const std::reverse_iterator<_Iterator>’ 7 | fin> a; | ^ /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: platou1.cpp:7:8: note: ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} is not derived from ‘const std::reverse_iterator<_Iterator>’ 7 | fin> a; | ^ /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: platou1.cpp:7:8: note: ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} is not derived from ‘const std::move_iterator<_IteratorL>’ 7 | fin> a; | ^ /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: platou1.cpp:7:8: note: ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} is not derived from ‘const std::move_iterator<_IteratorL>’ 7 | fin> a; | ^ 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: platou1.cpp:7:8: note: ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} is not derived from ‘const std::pair<_T1, _T2>’ 7 | fin> a; | ^ 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: platou1.cpp:7:8: note: ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’ 7 | fin> a; | ^ /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: platou1.cpp:7:8: note: ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’ 7 | fin> a; | ^ /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: platou1.cpp:7:8: note: mismatched types ‘const _CharT*’ and ‘std::basic_ifstream<char>’ 7 | fin> a; | ^ platou1.cpp:10:9: error: ‘cin’ was not declared in this scope 10 | while(cin>>b){ | ^~~ platou1.cpp:2:1: note: ‘std::cin’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’? 1 | #include <fstream> +++ |+#include <iostream> 2 | using namespace std; platou1.cpp:23:3: error: ‘cout’ was not declared in this scope 23 | cout<<lmax<<" "<<t; | ^~~~ platou1.cpp:23:3: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’? platou1.cpp:4:7: warning: unused variable ‘n’ [-Wunused-variable] 4 | int n,a,b,l,lmax,t; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema platou1 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ă.