#include<iostream> #include<string.h> using namespace std; const int N=100010; int h[N],hp[N],ph[N];//hp,ph,映射第k个插入的数字的位置,和位置为m的数是第几个插入的,两个数组互相映射 void heap_swap(int a,int b){ //交换时映射也需要改变,a,b表示下标, swap(hp[ph[a]],hp[ph[b]]); swap(ph[a],ph[b]); swap(h[a],h[b]); } int siz;//堆中总数 void down(i...