#2529
Se dau două șiruri de caractere, litere mici ale alfabetului englez. Să se afișeze cel mai lung subșir comun al lor.
| Problema | SubsirComunMaximal | Operații I/O |
subsircomunmaximal.in/subsircomunmaximal.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64420510 | Utilizator | |
| Fișier | subsircomunmaximal.cpp | Dimensiune | 449 B |
| Data încărcării | 06 Mai 2026, 09:12 | Scor/rezultat | 20 puncte |
subsircomunmaximal.cpp: In function ‘int main()’: subsircomunmaximal.cpp:11:14: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare] 11 | for(int i=1;i<=strlen(a);i++) | ~^~~~~~~~~~~ subsircomunmaximal.cpp:12:10: warning: array subscript has type ‘char’ [-Wchar-subscripts] 12 | v[a[i]]++; | ~~~^ subsircomunmaximal.cpp:13:14: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare] 13 | for(int i=1;i<=strlen(a);i++) | ~^~~~~~~~~~~ subsircomunmaximal.cpp:14:15: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare] 14 | {for(int j=1;j<=strlen(b);j++) | ~^~~~~~~~~~~ subsircomunmaximal.cpp:15:29: warning: array subscript has type ‘char’ [-Wchar-subscripts] 15 | if(a[i-1]==b[j-1] && v[a[i-1]]!=0) | ~~~~~^ subsircomunmaximal.cpp:15:1: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 15 | if(a[i-1]==b[j-1] && v[a[i-1]]!=0) | ^~ subsircomunmaximal.cpp:17:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 17 | v[a[i-1]]=0;} | ^ subsircomunmaximal.cpp:17:12: warning: array subscript has type ‘char’ [-Wchar-subscripts] 17 | v[a[i-1]]=0;} | ~~~~~^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | Corect ! | 20 | 20 | Exemplu | |
| 2 | 0.001 secunde | Incorect ! | 20 | 0 | ||
| 3 | 0.001 secunde | Incorect ! | 20 | 0 | ||
| 4 | 0.002 secunde | Incorect ! | 20 | 0 | ||
| 5 | 0.003 secunde | Incorect ! | 20 | 0 | ||
| Punctaj total | 20 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SubsirComunMaximal 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ă.