priority_queue 排序
两种写法等价(都是按照 堆顶是 x小的)但是在did内直接重载快得多!!!
struct did{
int x,y;
bool operator<(const did& t)const{
return t.x<x;
}
};
struct cmp{
bool operator()(did &a,did &b)
{
return a.x>b.x;
}
};
priority_queue<did>q;
priority_queue<did,vector<did> ,cmp>q;

浙公网安备 33010602011771号