优先队列的创建

1.

struct cmp1
{
    bool operator() (int a,int b)
    {
        return f[a]>f[b];    //opp
    }
};


priority_queue<int,vector<int>,cmp1 > a;

2.

struct node
{
    ll value;
    int pos,t;
    bool operator<(const node & a) const //第二个const必须有
    {
        return value<a.value;
    }
    bool operator<(const node &a) const
    {
        return value<a.value;
    }
};
原文地址:https://www.cnblogs.com/cmyg/p/9628516.html