#include<iostream>
#include<queue>
using namespace std;
struct node{
int x;
int y;
friend bool operator < (node a,node b)
{
if(a.x==b.x)
return a.y<b.y;
return a.x>b.x;
}
};
int main()
{
priority_queue<int,vector<int>,greater<int> > que1;// 數字越小優先級越高
priority_queue<int,vector<int>,less<int> > que2;// 數字越大優先級越高
priority_queue<node> que;// 自定義結構體優先隊列優先級
node now1={2,3};
node now2={1,4};
node now3={5,11};
node now4={2,4};
node now5={2,5};
que.push(now1);
que.push(now2);
que.push(now3);
que.push(now4);
que.push(now5);
while(!que.empty())
{
node k=que.top();
cout<<k.x<<" "<<k.y<<endl;
que.pop();
}
}