洛谷P1177快速排序

Posted Koreyoshi.

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了洛谷P1177快速排序相关的知识,希望对你有一定的参考价值。

#include<bits/stdc++.h>
using namespace std;
const int maxx = 100000 + 10;
int Heap[maxx];
int main() {
int n,num = 0,x;
scanf("%d",&n);
for(int i=1; i<=n; i++)
scanf("%d",&x),Heap[++num]=x,push_heap(Heap+1,Heap+num+1,greater<int>());
for(int i=1; i<=n; i++)
printf("%d ",Heap[1]),pop_heap(Heap+1,Heap+num+1,greater<int>()),num--;
return 0;
}

以上是关于洛谷P1177快速排序的主要内容,如果未能解决你的问题,请参考以下文章

洛谷 P1177 模板快速排序

洛谷P1177快速排序

P1177 模板快速排序

P1177快速排序

题解 P1177 模板快速排序

P1177 模板快速排序