#862
Se dă un vector cu n
elemente, numere naturale și două numere t
și k
. Să se determine câte secvențe din șir au lungimea k
și sunt formate din valori mai mici sau egale cu t
.
Problema | NrSecvente | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #58432912 | Utilizator | |
Fișier | nrsecvente.cpp | Dimensiune | 388 B |
Data încărcării | 04 Iunie 2025, 08:23 | Scor / rezultat | Eroare de compilare |
nrsecvente.cpp: In function 'int main()': nrsecvente.cpp:11:14: error: cannot bind 'std::istream {aka std::basic_istream<char>}' lvalue to 'std::basic_istream<char>&&' cin>>v; ^ In file included from /usr/include/c++/4.8/iostream:40:0, from nrsecvente.cpp:1: /usr/include/c++/4.8/istream:872:5: error: initializing argument 1 of 'std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&&, _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = int [1000001]]' operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x) ^ nrsecvente.cpp:15:14: error: cannot bind 'std::istream {aka std::basic_istream<char>}' lvalue to 'std::basic_istream<char>&&' cin>>v; ^ In file included from /usr/include/c++/4.8/iostream:40:0, from nrsecvente.cpp:1: /usr/include/c++/4.8/istream:872:5: error: initializing argument 1 of 'std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&&, _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = int [1000001]]' operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x) ^ nrsecvente.cpp:16:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] if(v<=t) ^ nrsecvente.cpp:8:14: warning: unused variable 'pc' [-Wunused-variable] int i,lc,pc,lmax,pozmax,t,k,nrs=0; ^ nrsecvente.cpp:8:17: warning: unused variable 'lmax' [-Wunused-variable] int i,lc,pc,lmax,pozmax,t,k,nrs=0; ^ nrsecvente.cpp:8:22: warning: unused variable 'pozmax' [-Wunused-variable] int i,lc,pc,lmax,pozmax,t,k,nrs=0; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema NrSecvente 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ă.