题目描述
blablabla
样例
blablabla
算法1
(暴力枚举) $O(n^2)$
blablabla
时间复杂度
参考文献
C++ 代码
include [HTML_REMOVED]
include [HTML_REMOVED]
include [HTML_REMOVED]
const int N = 1e6+10;
int n=0;
int q[N];
using namespace std;
void quick_sort(int q[],int l,int r)
{
if (l>=r) return;
int x=q[l],i=l-1,j=r+1;
while (i[HTML_REMOVED]x);
if (i<j) std::swap(q[i],q[j]);
quick_sort(q,l,j);
quick_sort(q,j+1,r);
}
}
int main()
{
int i=0;
scanf(“%d”,&n);
for (i=0;i<n;i)
{
scanf(“%d”,&q[i]);
}
quick_sort(q,0,n-1);
for (i=0;i<n;i) printf(“%d “,q[i]);
return 0;
}