一:归并排
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int maxn=1e5+5;
int a[maxn],temp[maxn];
void merg(int a[],int l,int mid,int r){
int i=l,j=mid+1,pos=l;
while(i<=mid&&j<=r){
if(a[i]<=a[j]) temp[pos++]=a[i++];
else temp[pos++]=a[j++];
}
while(i<=mid) temp[pos++]=a[i++];
while(j<=r) temp[pos++]=a[j++];
for(int i=l;i<=r;i++) a[i]=temp[i];
}
void mergsort(int a[],int l,int r){
if(l<r){
int mid=(l+r)>>1;
mergsort(a,l,mid);
mergsort(a,mid+1,r);
merg(a,l,mid,r);
}
}
int main(){
int n;