#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 | #64400065 | Utilizator | |
| Fișier | secvmax.cpp | Dimensiune | 759 B |
| Data încărcării | 05 Mai 2026, 10:47 | Scor/rezultat | Eroare de compilare |
secvmax.cpp:5:12: warning: missing terminating " character 5 | ofstream g("secvmax.out'); | ^ secvmax.cpp:5:12: error: missing terminating " character 5 | ofstream g("secvmax.out'); | ^~~~~~~~~~~~~~~ secvmax.cpp:6:19: error: ‘x’ has not been declared 6 | long long v[1001],x,n,q,c=0,s=0,k,d,a=-1,b=-1,m=-1,maxi=0; | ^ secvmax.cpp:6:21: error: ‘n’ has not been declared 6 | long long v[1001],x,n,q,c=0,s=0,k,d,a=-1,b=-1,m=-1,maxi=0; | ^ secvmax.cpp:6:23: error: ‘q’ has not been declared 6 | long long v[1001],x,n,q,c=0,s=0,k,d,a=-1,b=-1,m=-1,maxi=0; | ^ secvmax.cpp:6:25: error: ‘c’ has not been declared 6 | long long v[1001],x,n,q,c=0,s=0,k,d,a=-1,b=-1,m=-1,maxi=0; | ^ secvmax.cpp:6:29: error: ‘s’ has not been declared 6 | long long v[1001],x,n,q,c=0,s=0,k,d,a=-1,b=-1,m=-1,maxi=0; | ^ secvmax.cpp:6:33: error: ‘k’ has not been declared 6 | long long v[1001],x,n,q,c=0,s=0,k,d,a=-1,b=-1,m=-1,maxi=0; | ^ secvmax.cpp:6:35: error: ‘d’ has not been declared 6 | long long v[1001],x,n,q,c=0,s=0,k,d,a=-1,b=-1,m=-1,maxi=0; | ^ secvmax.cpp:6:37: error: ‘a’ has not been declared 6 | long long v[1001],x,n,q,c=0,s=0,k,d,a=-1,b=-1,m=-1,maxi=0; | ^ secvmax.cpp:6:42: error: ‘b’ has not been declared 6 | long long v[1001],x,n,q,c=0,s=0,k,d,a=-1,b=-1,m=-1,maxi=0; | ^ secvmax.cpp:6:47: error: ‘m’ has not been declared 6 | long long v[1001],x,n,q,c=0,s=0,k,d,a=-1,b=-1,m=-1,maxi=0; | ^ secvmax.cpp:6:52: error: ‘maxi’ has not been declared 6 | long long v[1001],x,n,q,c=0,s=0,k,d,a=-1,b=-1,m=-1,maxi=0; | ^~~~ secvmax.cpp:6:58: error: expected ‘)’ before ‘;’ token 6 | long long v[1001],x,n,q,c=0,s=0,k,d,a=-1,b=-1,m=-1,maxi=0; | ^ | ) secvmax.cpp:5:11: note: to match this ‘(’ 5 | ofstream g("secvmax.out'); | ^ secvmax.cpp:6:33: error: default argument missing for parameter 7 of ‘std::ofstream g(long long int*, int, int, int, int, int, int, int, int, int, int, int)’ 6 | long long v[1001],x,n,q,c=0,s=0,k,d,a=-1,b=-1,m=-1,maxi=0; | ^ secvmax.cpp:6:25: note: ...following parameter 5 which has a default argument 6 | long long v[1001],x,n,q,c=0,s=0,k,d,a=-1,b=-1,m=-1,maxi=0; | ^~~ secvmax.cpp:6:35: error: default argument missing for parameter 8 of ‘std::ofstream g(long long int*, int, int, int, int, int, int, int, int, int, int, int)’ 6 | long long v[1001],x,n,q,c=0,s=0,k,d,a=-1,b=-1,m=-1,maxi=0; | ^ secvmax.cpp: In function ‘int main()’: secvmax.cpp:9:7: error: ‘n’ was not declared in this scope 9 | f>>n; | ^ secvmax.cpp:10:9: error: ‘q’ was not declared in this scope 10 | for(q=1; q<=n; q++) | ^ secvmax.cpp:12:12: error: ‘v’ was not declared in this scope 12 | f>>v[q]; | ^ secvmax.cpp:13:9: error: ‘x’ was not declared in this scope 13 | x=v[q]; | ^ secvmax.cpp:17:17: error: ‘k’ was not declared in this scope 17 | k++; | ^ secvmax.cpp:18:17: error: ‘s’ was not declared in this scope 18 | s=s+x; | ^ secvmax.cpp:23:17: error: ‘k’ was not declared in this scope 23 | k=0; | ^ secvmax.cpp:24:17: error: ‘s’ was not declared in this scope 24 | s=0; | ^ secvmax.cpp:26:12: error: ‘k’ was not declared in this scope 26 | if(k>m) | ^ secvmax.cpp:26:14: error: ‘m’ was not declared in this scope; did you mean ‘tm’? 26 | if(k>m) | ^ | tm secvmax.cpp:30:13: error: ‘a’ was not declared in this scope 30 | a=q; | ^ secvmax.cpp:35:18: error: ‘s’ was not declared in this scope 35 | if(s>maxi) | ^ secvmax.cpp:35:20: error: ‘maxi’ was not declared in this scope 35 | if(s>maxi) | ^~~~ secvmax.cpp:39:19: error: ‘a’ was not declared in this scope 39 | a=q; | ^ secvmax.cpp:44:4: error: ‘a’ was not declared in this scope 44 | g<<a-m+1<<" "<<a; | ^ secvmax.cpp:44:6: error: ‘m’ was not declared in this scope; did you mean ‘tm’? 44 | g<<a-m+1<<" "<<a; | ^ | tm
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ă.