#include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
using namespace std;
struct Node{
int x , y;
Node(int a = 0 , int b = 0){
x = a , y = b;
}
};
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<Node> q;
q.push(Node(0 , 1));
q.push(Node(1 , 1));
q.push(Node(1 , 2));
while(!q.empty()){
Node t = q.top();
q.pop();
cout << t.x<<" " << t.y << endl;
}
return 0;
}
最后
以上就是激昂白昼最近收集整理的关于结构体优先队列排序的全部内容,更多相关结构体优先队列排序内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复