![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
[ACM]_STL
同学少年
没有什么不可能!
展开
-
[ACM] POJ 2418 Hardwood Species (Trie树或者map)
Hardwood SpeciesTime Limit: 10000MS Memory Limit: 65536KTotal Submissions: 17986 Accepted: 7138DescriptionHardwoods are the botanical group of trees that have b原创 2014-07-19 17:35:01 · 2789 阅读 · 0 评论 -
[ACM] POJ 1442 Black Box (堆,优先队列)
解题思路:给出一串数字序列,依次添加,问原创 2014-07-18 13:37:47 · 3646 阅读 · 0 评论 -
[ACM] POJ 3253 Fence Repair (Huffman树思想,优先队列)
Fence RepairTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 25274 Accepted: 8131DescriptionFarmer John wants to repair a small length of the fence aro原创 2014-07-18 08:19:23 · 1939 阅读 · 0 评论 -
[ACM] POJ 2442 Sequence (堆的性质)
解题思路: 有m行,每行n个数,从每行中取出一个数相加一起求出sum,这样的sum有n的m次方个。要求的前n个最小的sum值。第一次使用STL里面的堆,一开始对pop_heap()有点不太理解,后来明白了,比如对数组heap[n],最大下标为n-1建堆,默认的是建立大顶堆,heap[0]是数组中最大的数,写一条pop_heap()语句,就是把heap[0]和 heap[n原创 2014-07-17 20:18:59 · 2154 阅读 · 1 评论 -
[ACM] POJ 3096 Surprising Strings (map的使用)
Surprising StringsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 5783 Accepted: 3792DescriptionThe D-pairs of a string of letters are the ordered pai原创 2014-07-23 20:02:19 · 1526 阅读 · 0 评论 -
[ACM] 常用STL
1. stackstackst;//栈st,用于存放int型数据st.push(3);//将3入栈st.push(2);//将2入栈st.pop();//栈顶2出栈int Top = st.top();//获取栈顶元素,即3int Size = st.size();//求栈中的元素个数bool isEmpty = st.empty(); //栈中元素是否为空,1表示空,0表示非空原创 2016-03-01 19:10:18 · 3396 阅读 · 0 评论