归并排序模板
int a[10001], c[10001];
void Mergesort(int l, int r)
{
if (l >= r)
return;
int mid = (l + r) / 2;
Mergesort(l, mid);
Mergesort(mid + 1, r);
int i = l, j = mid + 1, k = 1;
while (i <= mid && j <= r)
{
if (a[i] < a[j])
c[k++] = a[i++];
else
c[k++] = a[j++];
}
for (int i = l; i <= r; ++i)
a[i] = c[i];
}