#4354
HalfSortQS
Se dă un vector cu n
elemente numere întregi nenule.
Să se ordoneze crescător subșirul format din elementele negative din vector și descrescător subșirul format din elementele pozitive.
Problema | HalfSortQS | Operații I/O |
halfsortqs.in /halfsortqs.out
|
---|---|---|---|
Limita timp | 0.8 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54730155 | Utilizator | |
Fișier | halfsortqs.cpp | Dimensiune | 725 B |
Data încărcării | 06 Decembrie 2024, 16:07 | Scor / rezultat | Eroare de compilare |
halfsortqs.cpp: In function 'int pivot(int, int)': halfsortqs.cpp:7:8: error: 'v' was not declared in this scope {int x=v[st]; ^ halfsortqs.cpp:8:11: warning: left operand of comma operator has no effect [-Wunused-value] while(st,dr) ^ halfsortqs.cpp: In function 'void Quick(int, int, int*)': halfsortqs.cpp:23:18: error: too few arguments to function 'void Quick(int, int, int*)' Quick(st,p-1); ^ halfsortqs.cpp:19:6: note: declared here void Quick(int st, int dr,int v[]) ^ halfsortqs.cpp:25:18: error: too few arguments to function 'void Quick(int, int, int*)' Quick(p+1,dr); ^ halfsortqs.cpp:19:6: note: declared here void Quick(int st, int dr,int v[]) ^ halfsortqs.cpp:20:6: warning: unused variable 'ka' [-Wunused-variable] {int ka=0,kb=0; ^ halfsortqs.cpp:20:11: warning: unused variable 'kb' [-Wunused-variable] {int ka=0,kb=0; ^ halfsortqs.cpp: In function 'int main()': halfsortqs.cpp:31:6: error: 'v' was not declared in this scope {f>>v[i]; ^ halfsortqs.cpp:32:13: error: 'a' was not declared in this scope if(v[i]>0)a[ka++]=v[i]; ^ halfsortqs.cpp:32:15: error: 'ka' was not declared in this scope if(v[i]>0)a[ka++]=v[i]; ^ halfsortqs.cpp:33:8: error: 'b' was not declared in this scope else b[kb++]=v[i]; ^ halfsortqs.cpp:33:10: error: 'kb' was not declared in this scope else b[kb++]=v[i]; ^ halfsortqs.cpp:35:10: error: 'kb' was not declared in this scope Quick(0,kb-1,a); ^ halfsortqs.cpp:35:15: error: 'a' was not declared in this scope Quick(0,kb-1,a); ^ halfsortqs.cpp:36:15: error: 'b' was not declared in this scope Quick(0,kb-1,b); ^ halfsortqs.cpp:38:6: error: 'v' was not declared in this scope {if(v[i]>0) ^ halfsortqs.cpp:28:10: warning: unused variable 'k' [-Wunused-variable] {int i,j,k,m,n,p; ^ halfsortqs.cpp:28:12: warning: unused variable 'm' [-Wunused-variable] {int i,j,k,m,n,p; ^ halfsortqs.cpp:28:16: warning: unused variable 'p' [-Wunused-variable] {int i,j,k,m,n,p; ^ halfsortqs.cpp:41:2: error: expected '}' at end of input } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema HalfSortQS 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ă.