int heap[MAX_N],int sz=0;void push(int x){ int i=sz++; while(i>0) { int p=(i-1)/2;//得到父节点 if(heap[p]<=x) break; heap[i]=heap[p]; i=p; } heap[i]=x;}int pop(){ int ret=heap[0]; int x=heap[--sz]; int i=0; while(i*2+1=x) break; heap[a]=x; i=a; } heap[i]=x; return ret;}