这种排序方式难道不比快速排序好吗?
时间复杂度 O(NlogN) 而且非常稳定!
#include<bits/stdc++.h>
using namespace std;
const int N = 1e6+10;
int n;
multiset<int>s;
int q[N];
int main() {
scanf("%d",&n);
for(int i = 0; i < n ; i++) scanf("%d",&q[i]);
for(int i = 0; i < n ; i++)s.insert(q[i]);
for(multiset<int>::iterator it=s.begin();it!=s.end();it++)printf("%d ",*it);
return 0;
}