#166
SecvMax
Să se determine cea mai lungă secvență de elemente pare dintr-un vector.
Problema | SecvMax | Operații I/O |
![]() secvmax.in /secvmax.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #50482940 | Utilizator | |
Fișier | secvmax.cpp | Dimensiune | 689 B |
Data încărcării | 11 Aprilie 2024, 09:47 | Scor / rezultat | Eroare de compilare |
secvmax.cpp:5:1: error: expected ',' or ';' before 'int' int n, i, cnt, ok, st, dr, x, maxi=-1, maxst, maxdr, smax, s; ^ secvmax.cpp: In function 'int main()': secvmax.cpp:7:12: error: 'n' was not declared in this scope fin >> n; ^ secvmax.cpp:8:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++){ ^ secvmax.cpp:9:16: error: 'x' was not declared in this scope fin >> x; ^ secvmax.cpp:11:16: error: 'ok' was not declared in this scope if(ok==0){ ^ secvmax.cpp:13:17: error: 'st' was not declared in this scope st=i; ^ secvmax.cpp:15:13: error: 's' was not declared in this scope s+=x; ^ secvmax.cpp:16:13: error: 'cnt' was not declared in this scope cnt++; ^ secvmax.cpp:18:16: error: 'maxi' was not declared in this scope if(maxi<=cnt && s>smax){ ^ secvmax.cpp:18:22: error: 'cnt' was not declared in this scope if(maxi<=cnt && s>smax){ ^ secvmax.cpp:18:29: error: 's' was not declared in this scope if(maxi<=cnt && s>smax){ ^ secvmax.cpp:18:31: error: 'smax' was not declared in this scope if(maxi<=cnt && s>smax){ ^ secvmax.cpp:20:17: error: 'dr' was not declared in this scope dr=i-1; ^ secvmax.cpp:21:17: error: 'ok' was not declared in this scope ok=0; ^ secvmax.cpp:23:17: error: 'maxst' was not declared in this scope maxst=st; ^ secvmax.cpp:23:23: error: 'st' was not declared in this scope maxst=st; ^ secvmax.cpp:24:17: error: 'maxdr' was not declared in this scope maxdr=dr; ^ secvmax.cpp:29:13: error: 'maxst' was not declared in this scope fout << maxst <<" "<<maxdr; ^ secvmax.cpp:29:26: error: 'maxdr' was not declared in this scope fout << maxst <<" "<<maxdr; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SecvMax 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ă.