标签:des style blog color java os io strong
5 3 3 -35 92 213 -644
213 92 3知识点:堆、STL#include <stdio.h> #include <algorithm> using namespace std; int a[1000000]; int main() { int i,n,m; while(EOF != scanf("%d %d",&n,&m)) { for(i=0;i<n;i++) scanf("%d",&a[i]); make_heap(a,a+n); printf("%d",a[0]); for(i=1;i<m;i++) { pop_heap(a,a+n-i+1); printf(" %d",a[0]); } printf("\n"); } return 0; }
hd1425 sort【堆排序】,布布扣,bubuko.com
标签:des style blog color java os io strong
原文地址:http://blog.csdn.net/hpuhjl/article/details/38580095