#include<iostream> #include<queue> using namespace std; struct node{ int x; int y; friend bool operator < (node a,node b) { return a.x>b.x; } }; int main() { priority_queue<node> que; node a; a.x=2; a.y=5; node b; b.x=3; b.y=7; node c; c.x=1; c.y=6; que.push(a); que.push(b); que.push(c); cout<<que.top().x<<" "<<que.top().y<<endl; que.pop(); cout<<que.top().x<<" "<<que.top().y<<endl; que.pop(); cout<<que.top().x<<" "<<que.top().y<<endl; que.pop(); }