#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 | #64995729 | Utilizator | |
| Fișier | interesant.cpp | Dimensiune | 2.41 KB |
| Data încărcării | 08 Iulie 2026, 13:42 | Scor/rezultat | 72 puncte |
interesant.cpp: In function ‘bool subSir(std::string, std::string)’: interesant.cpp:17:22: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 17 | for(int i=0;i<b.size();i++) | ~^~~~~~~~~ interesant.cpp:19:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 19 | if(poz_a<=a.size()&&a[poz_a]==b[i]) | ~~~~~^~~~~~~~~~ interesant.cpp:25:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 25 | if(poz_a==a.size()-1) | ~~~~~^~~~~~~~~~~~ interesant.cpp: In function ‘int main()’: interesant.cpp:55:27: warning: comparison of integer expressions of different signedness: ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare] 55 | if(s[i].size()>maxi) | ~~~~~~~~~~~^~~~~ interesant.cpp:60:32: warning: comparison of integer expressions of different signedness: ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare] 60 | else if(s[i].size()==maxi) | ~~~~~~~~~~~^~~~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 0 | 0.002 secunde | OK. | 5 | 5 | ||
| 1 | 0.003 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.088 secunde | OK. | 3 | 3 | ||
| 6 | 0.001 secunde | OK. | 3 | 3 | ||
| 7 | 0.034 secunde | OK. | 3 | 3 | ||
| 8 | 0.347 secunde | OK. | 4 | 4 | ||
| 9 | 0.114 secunde | OK. | 4 | 4 | ||
| 10 | 0.281 secunde | OK. | 4 | 4 | ||
| 11 | 0.147 secunde | Raspuns gresit. | 4 | 0 | ||
| 12 | 0.163 secunde | Raspuns gresit. | 4 | 0 | ||
| 13 | 0.125 secunde | OK. | 5 | 5 | ||
| 14 | 0.169 secunde | Raspuns gresit. | 5 | 0 | ||
| 15 | 0.29 secunde | Raspuns gresit. | 5 | 0 | ||
| 16 | 0.248 secunde | OK. | 5 | 5 | ||
| 17 | 0.176 secunde | Raspuns gresit. | 5 | 0 | ||
| 18 | 0.17 secunde | Raspuns gresit. | 5 | 0 | ||
| 19 | 0.551 secunde | OK. | 6 | 6 | ||
| 20 | 0.577 secunde | OK. | 6 | 6 | ||
| 21 | 0.176 secunde | OK. | 6 | 6 | ||
| Punctaj total | 72 | |||||
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ă.