摘要:
#include #include using namespace std;#define N 1000001int a[N],n;void headjust(int i,int size){ int left = i * 2,right = left + 1; int max = i; if(i a[max]) max = left; if(right a[max]) max = right; if(max != i) { swap(a[i],a[max]); ... 阅读全文