#2738
DistLungMax
Se dă un șir de caractere care conține cuvinte formate din litere mici ale alfabetului englez și separate printr-un singur spațiu. Să se determine cel mai lung cuvânt care are toate literele distincte. Dacă nu există niciun cuvânt cu toate literele distincte se va afișa -1
.
Problema | DistLungMax | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #55647602 | Utilizator | |
Fișier | distlungmax.cpp | Dimensiune | 898 B |
Data încărcării | 21 Ianuarie 2025, 13:31 | Scor / rezultat | 20 puncte |
distlungmax.cpp: In function 'int main()': distlungmax.cpp:8:5: warning: 'char* gets(char*)' is deprecated (declared at /usr/include/stdio.h:638) [-Wdeprecated-declarations] gets(s); ^ distlungmax.cpp:8:11: warning: 'char* gets(char*)' is deprecated (declared at /usr/include/stdio.h:638) [-Wdeprecated-declarations] gets(s); ^ distlungmax.cpp:22:37: warning: NULL used in arithmetic [-Wpointer-arith] for(int j=0; cuv[i][j]!=NULL; j++) ^ distlungmax.cpp:31:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if(strlen(cuv[i])>maxim) ^ distlungmax.cpp:8:12: warning: ignoring return value of 'char* gets(char*)', declared with attribute warn_unused_result [-Wunused-result] gets(s); ^ /tmp/cckrSslZ.o: In function \`main': distlungmax.cpp:(.text.startup+0x36): warning: the \`gets' function is dangerous and should not be used.
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
1 | 0 secunde | Raspuns gresit. | 20 | 0 | Exemplu | |
2 | 0 secunde | OK. | 20 | 20 | ||
3 | 0 secunde | Raspuns gresit. | 20 | 0 | ||
4 | 0 secunde | Raspuns gresit. | 20 | 0 | ||
5 | 0 secunde | Raspuns gresit. | 20 | 0 | ||
Punctaj total | 20 |
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema DistLungMax 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ă.