Aquabet

Talk is cheap. Show me the code.

0%

优先队列+自定义排序

自定义比较函数

1
2
3
4
5
struct cmp {
bool operator () (node a, node b) {
return a.value < b.value;//按value的小根堆
}
};

声明一个优先队列

1
priority_queue<node, vector<node >, cmp > aPriorityQueue;