Se dau două șiruri de caractere, litere mici ale alfabetului englez. Să se determine lungimea celui mai lung subșir comun.
| Problema | LungimeSubsirComunMaximal | Operații I/O |
lungimesubsircomunmaximal.in/lungimesubsircomunmaximal.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64951440 | Utilizator | |
| Fișier | lungimesubsircomunmaximal.cpp | Dimensiune | 751 B |
| Data încărcării | 22 Iunie 2026, 13:05 | Scor/rezultat | 100 puncte |
lungimesubsircomunmaximal.cpp: In function ‘int main()’: lungimesubsircomunmaximal.cpp:15:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 15 | for (int i = 1; i < a.size(); ++i) { | ~~^~~~~~~~~~ lungimesubsircomunmaximal.cpp:16:27: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 16 | for (int j = 1; j < b.size(); ++j) { | ~~^~~~~~~~~~ lungimesubsircomunmaximal.cpp:7:12: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | freopen("lungimesubsircomunmaximal.in", "r", stdin); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lungimesubsircomunmaximal.cpp:8:12: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | freopen("lungimesubsircomunmaximal.out", "w", stdout); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.002 secunde | OK. | 20 | 20 | Exemplu | |
| 2 | 0.001 secunde | OK. | 20 | 20 | ||
| 3 | 0.002 secunde | OK. | 20 | 20 | ||
| 4 | 0.002 secunde | OK. | 20 | 20 | ||
| 5 | 0.005 secunde | OK. | 20 | 20 | ||
| Punctaj total | 100 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema LungimeSubsirComunMaximal 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ă.