#3527
Să se scrie o funcție care să elimine nodurile care conțin duplicate dintr-o listă care are valorile ordonate crescător.
Folclorul informatic
| Problema | FStergeDuplicate | Operații I/O |
fstergeduplicate.in/fstergeduplicate.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 4 MB
/
Stivă 2 MB
|
| Id soluție | #64775731 | Utilizator | |
| Fișier | fstergeduplicate.cpp | Dimensiune | 404 B |
| Data încărcării | 29 Mai 2026, 15:00 | Scor/rezultat | Eroare de compilare |
fstergeduplicate.cpp:20:8: error: redefinition of ‘struct Nod’ 20 | struct Nod{ | ^~~ fstergeduplicate.cpp:4:8: note: previous definition of ‘struct Nod’ 4 | struct Nod | ^~~ fstergeduplicate.cpp: In function ‘void FStergeDuplicate(Nod*&)’: fstergeduplicate.cpp:26:29: error: ‘struct Nod’ has no member named ‘urm’ 26 | while(p!=NULL && p->urm!=NULL){ | ^~~ fstergeduplicate.cpp:27:18: error: ‘struct Nod’ has no member named ‘info’ 27 | if(p->info == p->urm->info){ | ^~~~ fstergeduplicate.cpp:27:29: error: ‘struct Nod’ has no member named ‘urm’ 27 | if(p->info == p->urm->info){ | ^~~ fstergeduplicate.cpp:28:23: error: ‘struct Nod’ has no member named ‘urm’ 28 | Nod *q=p->urm; | ^~~ fstergeduplicate.cpp:29:16: error: ‘struct Nod’ has no member named ‘urm’ 29 | p->urm=q->urm; | ^~~ fstergeduplicate.cpp:29:23: error: ‘struct Nod’ has no member named ‘urm’ 29 | p->urm=q->urm; | ^~~ fstergeduplicate.cpp:33:22: error: ‘struct Nod’ has no member named ‘urm’ 33 | p=p->urm; | ^~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema FStergeDuplicate 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ă.