优先队列比较器

1
2
3
4
5
6
7
struct cmp {
bool operator () (int i, int j) {
return a[i] > a[j];
}
};

priority_queue<int, vector<int>, cmp> q;