priority_queue

以dis为关键字的大根堆

struct Node {
ll dis, pos;
bool operator < (const Node &b) const {
return dis < b.dis;
}
};
priority_queue <Node> a;

以dis为关键字的小跟堆

struct Node {
ll dis, pos;
bool operator < (const Node &b) const {
return dis > b.dis;
}
};
priority_queue <Node> a;
posted @   觉清风  阅读(5)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示