#166
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 | #64823880 | Utilizator | |
| Fișier | secvmax.cpp | Dimensiune | 512 B |
| Data încărcării | 03 Iunie 2026, 20:05 | Scor/rezultat | 100 puncte |
secvmax.cpp: In function ‘int main()’: secvmax.cpp:20:44: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] 20 | if(lg>lg_max || lg==lg_max && suma>suma_max) { | ~~~~~~~~~~~^~~~~~~~~~~~~~~~ secvmax.cpp:9:48: warning: unused variable ‘st’ [-Wunused-variable] 9 | int st_max,dr_max,lg_max=0,suma_max=-1,st,dr,lg=0,suma=0; | ^~ secvmax.cpp:9:51: warning: unused variable ‘dr’ [-Wunused-variable] 9 | int st_max,dr_max,lg_max=0,suma_max=-1,st,dr,lg=0,suma=0; | ^~ secvmax.cpp:27:16: warning: ‘st_max’ may be used uninitialized [-Wmaybe-uninitialized] 27 | fout<<st_max<<" "<<dr_max; | ^~~ secvmax.cpp:9:13: note: ‘st_max’ was declared here 9 | int st_max,dr_max,lg_max=0,suma_max=-1,st,dr,lg=0,suma=0; | ^~~~~~ secvmax.cpp:27:21: warning: ‘dr_max’ may be used uninitialized [-Wmaybe-uninitialized] 27 | fout<<st_max<<" "<<dr_max; | ^~~~~~ secvmax.cpp:9:20: note: ‘dr_max’ was declared here 9 | int st_max,dr_max,lg_max=0,suma_max=-1,st,dr,lg=0,suma=0; | ^~~~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.002 secunde | OK. | 20 | 20 | ||
| 2 | 0.001 secunde | OK. | 20 | 20 | ||
| 3 | 0.001 secunde | OK. | 20 | 20 | ||
| 4 | 0.002 secunde | OK. | 20 | 20 | ||
| 5 | 0.001 secunde | OK. | 20 | 20 | ||
| Punctaj total | 100 | |||||
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ă.