#1025
MergeSort
Se dă un șir cu n
elemente, numere întregi. Folosind metoda MergeSort, ordonați crescător elementele acestui șir.
Problema | MergeSort | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.3 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #50163903 | Utilizator | |
Fișier | mergesort.cpp | Dimensiune | 779 B |
Data încărcării | 29 Martie 2024, 10:45 | Scor / rezultat | Eroare de compilare |
mergesort.cpp: In function 'void mergesort(int, int)': mergesort.cpp:9:7: error: 'i' was not declared in this scope i=st;j=mid+1;k=0; ^ mergesort.cpp:9:12: error: 'j' was not declared in this scope i=st;j=mid+1;k=0; ^ mergesort.cpp:9:20: error: 'k' was not declared in this scope i=st;j=mid+1;k=0; ^ mergesort.cpp:11:12: error: 'v' was not declared in this scope if(v[i]<v[j]){ ^ mergesort.cpp:13:13: error: 'c' was not declared in this scope c[k]=v[i]; ^ mergesort.cpp:18:13: error: 'c' was not declared in this scope c[k]=v[j]; ^ mergesort.cpp:23:13: error: 'c' was not declared in this scope c[k]=v[i]; ^ mergesort.cpp:23:18: error: 'v' was not declared in this scope c[k]=v[i]; ^ mergesort.cpp:28:13: error: 'c' was not declared in this scope c[k]=v[j]; ^ mergesort.cpp:28:18: error: 'v' was not declared in this scope c[k]=v[j]; ^ mergesort.cpp:32:13: error: 'v' was not declared in this scope v[st+i-1]=c[i]; ^ mergesort.cpp:32:23: error: 'c' was not declared in this scope v[st+i-1]=c[i]; ^ mergesort.cpp: In function 'int main()': mergesort.cpp:41:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++)cin>>v[i]; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema MergeSort 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ă.