#519
Se dă un vector x cu n elemente, numere naturale, și un vector y cu m elemente, numere naturale. Să se verifice dacă vectorul y este secvență în vectorul x.
| Problema | Secventa1 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64288059 | Utilizator | |
| Fișier | secventa1.cpp | Dimensiune | 349 B |
| Data încărcării | 28 Aprilie 2026, 09:55 | Scor/rezultat | Eroare de compilare |
secventa1.cpp: In function ‘int main()’: secventa1.cpp:6:6: error: ‘nrx’ was not declared in this scope 6 | cin>>nrx>>nry; | ^~~ secventa1.cpp:6:11: error: ‘nry’ was not declared in this scope 6 | cin>>nrx>>nry; | ^~~ secventa1.cpp:12:29: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 12 | for(int j=1;i+j-1<=n;&&j<=m;x[i+j-1]==y[j];j++) | ~~~^~~ secventa1.cpp:12:29: warning: for increment expression has no effect [-Wunused-value] secventa1.cpp:12:32: error: expected ‘)’ before ‘;’ token 12 | for(int j=1;i+j-1<=n;&&j<=m;x[i+j-1]==y[j];j++) | ~ ^ | ) secventa1.cpp:12:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 12 | for(int j=1;i+j-1<=n;&&j<=m;x[i+j-1]==y[j];j++) | ^~~ secventa1.cpp:12:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 12 | for(int j=1;i+j-1<=n;&&j<=m;x[i+j-1]==y[j];j++) | ^ secventa1.cpp:12:37: error: ‘j’ was not declared in this scope 12 | for(int j=1;i+j-1<=n;&&j<=m;x[i+j-1]==y[j];j++) | ^ secventa1.cpp:5:27: warning: unused variable ‘p’ [-Wunused-variable] 5 | { int x[1001],y[1001],n,m,p; | ^ secventa1.cpp:12:28: error: label ‘j’ used but not defined 12 | for(int j=1;i+j-1<=n;&&j<=m;x[i+j-1]==y[j];j++) | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Secventa1 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ă.