首页 > 其他 > 详细

优先队列 重写优先级

时间:2015-03-10 22:40:54      阅读:190      评论:0      收藏:0      [点我收藏+]
#include<queue>
#include<vector>
using namespace std;

struct cmp       //重写优先关系 从大到小
{
    bool operator () (const int a, const int b) const
    {
        return a%10 > b%10;
    }
};

int main()
{
    priority_queue<int, vector<int>,cmp> pq;  //优先队列的声明
    return 0;
}

 

优先队列 重写优先级

原文:http://www.cnblogs.com/qyy-goodluck/p/4328390.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!