struct P { int x; bool operator < (const P &a) const { return x > a.x;//从小到大 } }; priority_queue<P> q;