#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 | #64628140 | Utilizator | |
| Fișier | fstergeduplicate.cpp | Dimensiune | 161 B |
| Data încărcării | 19 Mai 2026, 12:14 | Scor/rezultat | Eroare de compilare |
fstergeduplicate.cpp: In function ‘void FStergeDuplicate(Nod*&)’: fstergeduplicate.cpp:18:17: error: no matching function for call to ‘Nod::Nod()’ 18 | Nod l = new Nod; | ^~~ fstergeduplicate.cpp:8:5: note: candidate: ‘Nod::Nod(int)’ 8 | Nod(int x) | ^~~ fstergeduplicate.cpp:8:5: note: candidate expects 1 argument, 0 provided fstergeduplicate.cpp:4:8: note: candidate: ‘constexpr Nod::Nod(const Nod&)’ 4 | struct Nod | ^~~ fstergeduplicate.cpp:4:8: note: candidate expects 1 argument, 0 provided fstergeduplicate.cpp:4:8: note: candidate: ‘constexpr Nod::Nod(Nod&&)’ fstergeduplicate.cpp:4:8: note: candidate expects 1 argument, 0 provided fstergeduplicate.cpp:19:6: error: base operand of ‘->’ has non-pointer type ‘Nod’ 19 | l->info = x; | ^~ fstergeduplicate.cpp:19:15: error: ‘x’ was not declared in this scope 19 | l->info = x; | ^ fstergeduplicate.cpp:22:8: warning: init-statement in selection statements only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions] 22 | if(l->info = l->(info+1);) | ^ fstergeduplicate.cpp:22:9: error: base operand of ‘->’ has non-pointer type ‘Nod’ 22 | if(l->info = l->(info+1);) | ^~ fstergeduplicate.cpp:22:19: error: base operand of ‘->’ has non-pointer type ‘Nod’ 22 | if(l->info = l->(info+1);) | ^~ fstergeduplicate.cpp:22:21: error: expected unqualified-id before ‘(’ token 22 | if(l->info = l->(info+1);) | ^ fstergeduplicate.cpp:22:22: error: ‘info’ was not declared in this scope 22 | if(l->info = l->(info+1);) | ^~~~ fstergeduplicate.cpp:22:30: error: expected primary-expression before ‘)’ token 22 | if(l->info = l->(info+1);) | ^ fstergeduplicate.cpp:23:8: error: type ‘<type error>’ argument given to ‘delete’, expected pointer 23 | delete x;return; | ^~~~~~~~ fstergeduplicate.cpp:22:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 22 | if(l->info = l->(info+1);) | ^~ fstergeduplicate.cpp:23:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 23 | delete x;return; | ^~~~~~
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ă.