你可以写
priority_queue <int, vector<int>, greater<int> > q
来创建一个小根堆
priority_queue <int> q;
然后存的时候存想存的数的相反数,调用时调堆顶的相反数 我简直是个添柴!!!