#1024
Se dă un șir cu n elemente, numere întregi. Folosind metoda QuickSort, ordonați crescător elementele acestui șir.
| Problema | QuickSort | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.3 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64346282 | Utilizator | |
| Fișier | quicksort.cpp | Dimensiune | 669 B |
| Data încărcării | 30 Aprilie 2026, 19:10 | Scor/rezultat | Eroare de compilare |
quicksort.cpp: In function ‘int pivot(int, int)’: quicksort.cpp:7:5: error: ‘in’ was not declared in this scope; did you mean ‘int’? 7 | in aux=v[st]; | ^~ | int quicksort.cpp:10:31: error: ‘aux’ was not declared in this scope 10 | while(st<dr && v[dr]>=aux) | ^~~ quicksort.cpp:10:9: warning: this ‘while’ clause does not guard... [-Wmisleading-indentation] 10 | while(st<dr && v[dr]>=aux) | ^~~~~ quicksort.cpp:12:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘while’ 12 | v[st]=v[dr]; | ^ quicksort.cpp:13:31: error: ‘aux’ was not declared in this scope 13 | while(st<dr && v[st]<=aux) | ^~~ quicksort.cpp:18:11: error: ‘aux’ was not declared in this scope 18 | v[st]=aux; | ^~~ quicksort.cpp: In function ‘void quicksort(int, int)’: quicksort.cpp:25:9: error: ‘quicksorrt’ was not declared in this scope; did you mean ‘quicksort’? 25 | quicksorrt(st,m-1); | ^~~~~~~~~~ | quicksort quicksort.cpp:24:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 24 | if(st<m) | ^~ quicksort.cpp:26:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 26 | if(m<dr) | ^~ quicksort.cpp:27:9: error: ‘quciksort’ was not declared in this scope; did you mean ‘quicksort’? 27 | quciksort(m+1,dr); | ^~~~~~~~~ | quicksort quicksort.cpp: In function ‘int main()’: quicksort.cpp:31:10: error: ‘n’ was not declared in this scope 31 | cin>>n; | ^ quicksort.cpp:38:11: error: ‘c’ was not declared in this scope 38 | cout<<c[i]; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema QuickSort 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ă.