#518
Se dă un vector cu n elemente numere naturale. Determinați cea mai lungă secvență de elemente nule din vector. Dacă în vector există mai multe secvențe de elemente nule de lungime maximă se va determina cea mai din stânga.
| Problema | SecvZero | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64589647 | Utilizator | |
| Fișier | secvzero.cpp | Dimensiune | 427 B |
| Data încărcării | 17 Mai 2026, 10:06 | Scor/rezultat | 0 puncte |
secvzero.cpp: In function ‘int main()’: secvzero.cpp:7:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 7 | for(i=1;i<=n;i++) | ^~~ secvzero.cpp:9:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 9 | for(i=1;i<=n;i++) | ^~~ secvzero.cpp:17:13: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 17 | if(j-i>max) | ^~ secvzero.cpp:18:26: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 18 | max=j-i; st=i; dr=j-i; | ^~ secvzero.cpp:23:15: warning: ‘st’ may be used uninitialized [-Wmaybe-uninitialized] 23 | cout<<st<<" "<<dr; | ^~~ secvzero.cpp:5:15: note: ‘st’ was declared here 5 | int n,i,j,st,dr,max,a[1001]; | ^~ secvzero.cpp:23:20: warning: ‘dr’ may be used uninitialized [-Wmaybe-uninitialized] 23 | cout<<st<<" "<<dr; | ^~ secvzero.cpp:5:18: note: ‘dr’ was declared here 5 | int n,i,j,st,dr,max,a[1001]; | ^~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | Depășit | Limita de timp depășită | 20 | 0 | Exemplu | |
| 2 | Depășit | Limita de timp depășită | 40 | 0 | ||
| 3 | 0.003 secunde | Caught fatal signal 11 | 40 | 0 | ||
| Punctaj total | 0 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SecvZero 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ă.