#1620
Se consideră o mulțime S care conține N șiruri de caractere formate din litere mici ale alfabetului englezesc.
Un șir de caractere se numește interesant în raport cu celelalte șiruri ale mulțimii, dacă nu există un alt șir în mulțime care să-l conțină ca subșir. De exemplu, dacă mulțimea S conține șirurile abc, bde și abcdef, atunci singurul șir interesant este abcdef deoarece abc și bde nu îl conțin ca subșir. Mai mult, abc și bde sunt subșiruri în abcdef, deci nu sunt interesante.
Fiind dată o mulțime S formată din N șiruri de caractere se cere:
S.OJI 2016, Clasa a X-a
| Problema | Interesant | Operații I/O |
interesant.in/interesant.out
|
|---|---|---|---|
| Limita timp | 1.5 secunde | Limita memorie |
Total: 8 MB
/
Stivă 8 MB
|
| Id soluție | #64935454 | Utilizator | |
| Fișier | interesant.cpp | Dimensiune | 1.31 KB |
| Data încărcării | 16 Iunie 2026, 20:28 | Scor/rezultat | 100 puncte |
interesant.cpp: In function ‘int main()’: interesant.cpp:18:28: warning: comparison of integer expressions of different signedness: ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare] 18 | if( s[i].size() > maxx ){ | ~~~~~~~~~~~~^~~~~~ interesant.cpp:22:33: warning: comparison of integer expressions of different signedness: ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare] 22 | else if( s[i].size() == maxx && s[i] < x ){ | ~~~~~~~~~~~~^~~~~~~ interesant.cpp:35:30: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 35 | for( h = 0; h < s[i].size(); h++ ){ | ~~^~~~~~~~~~~~~ interesant.cpp:36:29: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 36 | while( k < s[j].size() && s[j][k] != s[i][h] ) | ~~^~~~~~~~~~~~~ interesant.cpp:38:26: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 38 | if( k == s[j].size() ) | ~~^~~~~~~~~~~~~~ interesant.cpp:42:22: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 42 | if( h == s[i].size() ) | ~~^~~~~~~~~~~~~~ interesant.cpp:51:18: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<std::__cxx11::basic_string<char> >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 51 | for( i = 0; i < v.size(); i++ ) | ~~^~~~~~~~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 0 | 0.002 secunde | OK. | 5 | 5 | ||
| 1 | 0.002 secunde | OK. | 5 | 5 | ||
| 2 | 0.002 secunde | OK. | 5 | 5 | ||
| 3 | 0.001 secunde | OK. | 5 | 5 | ||
| 4 | 0.001 secunde | OK. | 3 | 3 | ||
| 5 | 0.063 secunde | OK. | 3 | 3 | ||
| 6 | 0.001 secunde | OK. | 3 | 3 | ||
| 7 | 0.029 secunde | OK. | 3 | 3 | ||
| 8 | 0.179 secunde | OK. | 4 | 4 | ||
| 9 | 0.056 secunde | OK. | 4 | 4 | ||
| 10 | 0.153 secunde | OK. | 4 | 4 | ||
| 11 | 0.072 secunde | OK. | 4 | 4 | ||
| 12 | 0.083 secunde | OK. | 4 | 4 | ||
| 13 | 0.058 secunde | OK. | 5 | 5 | ||
| 14 | 0.086 secunde | OK. | 5 | 5 | ||
| 15 | 0.189 secunde | OK. | 5 | 5 | ||
| 16 | 0.144 secunde | OK. | 5 | 5 | ||
| 17 | 0.084 secunde | OK. | 5 | 5 | ||
| 18 | 0.088 secunde | OK. | 5 | 5 | ||
| 19 | 0.422 secunde | OK. | 6 | 6 | ||
| 20 | 0.427 secunde | OK. | 6 | 6 | ||
| 21 | 0.077 secunde | OK. | 6 | 6 | ||
| Punctaj total | 100 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Interesant 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ă.