#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 | #64820745 | Utilizator | |
| Fișier | quicksort.cpp | Dimensiune | 1.00 KB |
| Data încărcării | 03 Iunie 2026, 16:09 | Scor/rezultat | Eroare de compilare |
quicksort.cpp: In function ‘int main()’: quicksort.cpp:24:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 24 | for(i=1; i<=n; i++) | ^~~ quicksort.cpp:26:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 26 | sort1(1,n); | ^~~~~ quicksort.cpp: At global scope: quicksort.cpp:35:5: error: redefinition of ‘int n’ 35 | int n,a[100005],i,pos; | ^ quicksort.cpp:4:5: note: ‘int n’ previously declared here 4 | int n,a[100005],i,pos; | ^ quicksort.cpp:35:7: error: redefinition of ‘int a [100005]’ 35 | int n,a[100005],i,pos; | ^ quicksort.cpp:4:7: note: ‘int a [100005]’ previously declared here 4 | int n,a[100005],i,pos; | ^ quicksort.cpp:35:17: error: redefinition of ‘int i’ 35 | int n,a[100005],i,pos; | ^ quicksort.cpp:4:17: note: ‘int i’ previously declared here 4 | int n,a[100005],i,pos; | ^ quicksort.cpp:35:19: error: redefinition of ‘int pos’ 35 | int n,a[100005],i,pos; | ^~~ quicksort.cpp:4:19: note: ‘int pos’ previously declared here 4 | int n,a[100005],i,pos; | ^~~ quicksort.cpp:36:5: error: redefinition of ‘int part(int, int)’ 36 | int part(int st,int dr) | ^~~~ quicksort.cpp:5:5: note: ‘int part(int, int)’ previously defined here 5 | int part(int st,int dr) | ^~~~ quicksort.cpp:45:6: error: redefinition of ‘void sort1(int, int)’ 45 | void sort1(int st,int dr) | ^~~~~ quicksort.cpp:14:6: note: ‘void sort1(int, int)’ previously defined here 14 | void sort1(int st,int dr) | ^~~~~ quicksort.cpp:52:5: error: redefinition of ‘int main()’ 52 | int main() | ^~~~ quicksort.cpp:21:5: note: ‘int main()’ previously defined here 21 | int main() | ^~~~ quicksort.cpp: In function ‘int main()’: quicksort.cpp:55:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 55 | for(i=1; i<=n; i++) | ^~~ quicksort.cpp:57:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 57 | sort1(1,n); | ^~~~~
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ă.