#4686
O listă simplu înlănțuită are cheile nodurilor, în valoare absolută, ordonate crescător. Să se reordoneze nodurile astfel încât cheile să fie ordonate crescător.
Problemă de interviu
Problema | FLsiReord | Operații I/O |
![]() flsireord.in /flsireord.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 16 MB
/
Stivă 8 MB
|
Id soluție | #57500147 | Utilizator | |
Fișier | flsireord.cpp | Dimensiune | 1.19 KB |
Data încărcării | 02 Aprilie 2025, 14:46 | Scor / rezultat | Eroare de compilare |
flsireord.cpp:25:18: error: reference to 'stack' is ambiguous void push(struct stack *stack, int val) ^ flsireord.cpp:20:8: note: candidates are: struct stack struct stack { ^ In file included from /usr/include/c++/4.8/stack:61:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:88, from flsireord.cpp:1: /usr/include/c++/4.8/bits/stl_stack.h:96:11: note: template<class _Tp, class _Sequence> class std::stack class stack ^ flsireord.cpp: In function 'void push(int*, int)': flsireord.cpp:27:25: error: no matching function for call to 'nod::nod()' nod *new_node = new nod; ^ flsireord.cpp:27:25: note: candidates are: flsireord.cpp:8:5: note: nod::nod(int) nod(int x) ^ flsireord.cpp:8:5: note: candidate expects 1 argument, 0 provided flsireord.cpp:4:8: note: constexpr nod::nod(const nod&) struct nod ^ flsireord.cpp:4:8: note: candidate expects 1 argument, 0 provided flsireord.cpp:4:8: note: constexpr nod::nod(nod&&) flsireord.cpp:4:8: note: candidate expects 1 argument, 0 provided flsireord.cpp:29:28: error: request for member 'head' in '* stack', which is of non-class type 'int' new_node->urm = stack->head; ^ flsireord.cpp:30:12: error: request for member 'head' in '* stack', which is of non-class type 'int' stack->head = new_node; ^ flsireord.cpp:32:16: error: request for member 'tail' in '* stack', which is of non-class type 'int' if (stack->tail == nullptr) { ^ flsireord.cpp:33:16: error: request for member 'tail' in '* stack', which is of non-class type 'int' stack->tail = new_node; ^ flsireord.cpp: In function 'void Reord(nod*&)': flsireord.cpp:39:5: error: reference to 'stack' is ambiguous stack negatives; ^ flsireord.cpp:20:8: note: candidates are: struct stack struct stack { ^ In file included from /usr/include/c++/4.8/stack:61:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:88, from flsireord.cpp:1: /usr/include/c++/4.8/bits/stl_stack.h:96:11: note: template<class _Tp, class _Sequence> class std::stack class stack ^ flsireord.cpp:39:11: error: expected ';' before 'negatives' stack negatives; ^ flsireord.cpp:40:5: error: 'negatives' was not declared in this scope negatives.head = nullptr; ^ flsireord.cpp:51:29: error: no matching function for call to 'nod::nod()' nod *node = new nod; ^ flsireord.cpp:51:29: note: candidates are: flsireord.cpp:8:5: note: nod::nod(int) nod(int x) ^ flsireord.cpp:8:5: note: candidate expects 1 argument, 0 provided flsireord.cpp:4:8: note: constexpr nod::nod(const nod&) struct nod ^ flsireord.cpp:4:8: note: candidate expects 1 argument, 0 provided flsireord.cpp:4:8: note: constexpr nod::nod(nod&&) flsireord.cpp:4:8: note: candidate expects 1 argument, 0 provided
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema FLsiReord 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ă.