c++优先队列,小根堆

一直对priority不会,如今要记一下了c++ priority_queue<int,vector<int>,greater<int> >q; 这样的话,咱们能够获得一个小根堆; 意思大概是<类型,<存储方式>,<比较函数> >; 可是这个小根堆只能支持int; 反正我不会啦;web struct cs{ int x; bool operator < (const cs &rhs
相关文章
相关标签/搜索