
STL
文章平均质量分 66
slicer
生命不息,奋斗不止
展开
-
hdu 1280 前m大的数
hdu 1280 前m大的数 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1280 题目分析:求出来存进优先队列(升序),存的时候只要size大于m就pop,最后用一下栈反着输出来就行了。 code: #include #include #include using namespace std; struct cmp原创 2014-02-26 20:07:55 · 798 阅读 · 0 评论 -
优先队列DIY
默认的优先队列是个极大堆,如果要改变优先队列中元素的优先级,有下面这些方法 struct cmp1 { bool operator ()(int &a,int &b) { return a>b;//最小值优先 } }; struct cmp2 { bool operator ()(int &a,int &b) {转载 2014-03-15 13:00:07 · 595 阅读 · 0 评论 -
POJ 3750 小孩报数问题
POJ 3750 小孩报数问题原创 2014-07-21 17:38:20 · 1032 阅读 · 0 评论