#1256
Sa se verifice dacă o listă simplu înlănțuită formează un palindrom.
| Problema | FListaVerPalindrom | Operații I/O |
flistaverpalindrom.in/flistaverpalindrom.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 4 MB
/
Stivă 4 MB
|
| Id soluție | #62381739 | Utilizator | |
| Fișier | flistaverpalindrom.cpp | Dimensiune | 519 B |
| Data încărcării | 19 Ianuarie 2026, 21:37 | Scor/rezultat | Eroare de compilare |
flistaverpalindrom.cpp:26:8: error: redefinition of 'struct node' struct node { ^ flistaverpalindrom.cpp:9:8: error: previous definition of 'struct node' struct node { ^ flistaverpalindrom.cpp:29:3: error: invalid type in declaration before ';' token }p; ^ flistaverpalindrom.cpp: In function 'bool checkIfPalindrom(char*)': flistaverpalindrom.cpp:32:40: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 0; i < strlen(string)/2; i++) { ^ flistaverpalindrom.cpp: In function 'bool palindrom(node*)': flistaverpalindrom.cpp:42:7: error: invalid conversion from 'node*' to 'int' [-fpermissive] p = l; ^ flistaverpalindrom.cpp:43:13: error: base operand of '->' is not a pointer while (p->next != NULL) { ^ flistaverpalindrom.cpp:44:15: error: expected unqualified-id before '[' token string[k++] = l.key; ^ flistaverpalindrom.cpp:45:14: error: base operand of '->' is not a pointer p = p->next; ^ flistaverpalindrom.cpp:47:5: error: 'retun' was not declared in this scope retun checkIfPalindrom(string); ^ flistaverpalindrom.cpp:47:11: error: expected ';' before 'checkIfPalindrom' retun checkIfPalindrom(string); ^ flistaverpalindrom.cpp:41:9: warning: unused variable 'k' [-Wunused-variable] int k = 0; ^ flistaverpalindrom.cpp:49:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema FListaVerPalindrom face parte din a doua categorie. Pentru aceste probleme se folosește un program suport, furnizat de propunătorul problemei. 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ă.