stl
神探特斯拉
这个作者很懒,什么都没留下…
展开
-
POJ 1273 Drainage Ditches (最大流问题——Edmonds-Karp算法)
一.最大流问题最大流问题最形象的比喻就是给定一个有向图G(V,E),每个边有一定的权值表示边的容量,再给定起点s和终点t,s处有水不断的流出,t是一个蓄水池,问最多有多少水从s流进了t?二.Edmonds-Karp算法简单来说这个算法就是不断重复这样的操作:1.从图中找到s到t的路径(为了减小时间复杂度使用bfs来寻找最短的一条路径),如果找不到路径,那么就结束。2.找到的该路原创 2016-05-10 11:24:37 · 709 阅读 · 0 评论 -
The 36th ACM/ICPC Asia Regional Dalian Site 1004 The kth great number
The kth great number Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65768/65768K (Java/Other)Total Submission(s) : 9 Accepted Submission(s) : 5Font: Times New Roman | Verdana | G原创 2016-09-16 18:13:39 · 396 阅读 · 0 评论 -
UVa 10954 Add All(贪心)
Yup!! The problem name reflects your task; just add a set of numbers. But you may feel yourselves condescended, to write a C/C++ program just to add a set of numbers. Such a problem will simply questi原创 2016-07-03 21:55:56 · 610 阅读 · 0 评论 -
HDU 5831 Rikka with Parenthesis II(栈的使用)
Rikka with Parenthesis IITime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 78 Accepted Submission(s): 61Problem DescriptionAs w原创 2016-08-11 19:22:27 · 521 阅读 · 0 评论 -
HDU 1495 非常可乐!!!(隐式图状态搜索+bfs+map状态查重)
非常可乐Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 11306 Accepted Submission(s): 4558Problem Description大家一定觉的运动以后喝可乐是一件很惬意的原创 2016-08-23 18:37:01 · 854 阅读 · 0 评论 -
HDU 1082 Matrix Chain Multiplication(栈和map的使用)
Matrix multiplication problem is a typical example of dynamical programming. Suppose you have to evaluate an expression like A*B*C*D*E where A,B,C,D and E are matrices. Since matrix multiplication原创 2016-07-30 09:42:46 · 377 阅读 · 0 评论 -
POJ 2823 Sliding Window(单调队列)
An array of size n ≤ 106 is given to you. There is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time原创 2016-07-27 15:28:17 · 243 阅读 · 0 评论 -
HDOJ 5762 Teacher Bo
Teacher BoBo is a geography teacher in the school.One day in his class,he marked N points in the map,the i-th point is at (Xi,Yi).He wonders,whether there is a tetrad (A,B,C,D)(AB,CD,A≠CorB≠D) s原创 2016-07-27 14:00:07 · 330 阅读 · 0 评论 -
UVa 156 (stl map的使用)
一。mapmap就是从键(key)到值(value)的映射,重载了[]所以可以认为是高级版的数组,常用的一些操作如下:头文件:#include定义:map name key称为map的frist,value称为map的second。初始化:name.clear();二.题目 AnanagramsMost crossword puzzl原创 2016-05-09 21:10:46 · 973 阅读 · 0 评论 -
UVa 12166(字符型二叉树的dfs)
一.题目[PDF Link]A mobile is a type of kinetic sculpture constructed to take advantage of the principle of equilibrium. It consists of a number of rods, from which weighted objects or further rods ha原创 2016-05-09 20:53:52 · 1404 阅读 · 0 评论 -
POJ 1338 Ugly Numbers(丑数)
一.问题分析首先啊。。。。这种题在有了大致的思路了以后就不要再照着书去实现了,真的就没什么意思了》》但就这个问题本身而言还是蛮有意思的嘛,用到了集合法对元素进行判重,其实map也是可以实现的嘛,还有就是一开始我的想法是按照素数分解每个丑数都可以分解成为2^z*3^x*5^y,这种形式,但是一时也没找出好的方案来生成合理有序的xyz序列(其实根本就是没有动脑子吧,下次中午要好好睡觉!),最后发现原创 2016-05-12 15:43:37 · 362 阅读 · 0 评论 -
HDOJ 1027Ignatius and the Princess II(全排列)
Problem DescriptionNow our hero finds the door to the BEelzebub feng5166. He opens the door and finds feng5166 is about to kill our pretty Princess. But now the BEelzebub has to beat our hero firs原创 2016-02-09 22:18:11 · 294 阅读 · 0 评论 -
UVa 712 S-Trees(满二叉树数组保存与编号)
一.满二叉树我们发现满二叉树的编号具有这样的性质即根节点为n的话,那么其左子树的编号应该是2n,右子树的编号应该是2n+1,有了的这样的性质,我们就可以很假单的用线性表来保存满二叉树的节点,注意,这样的性质非满二叉树并不具有,所以不可以用这样的方法来保存。二.A Strange Tree (S-tree) over the variable set Xn = {x1,x2,...,原创 2016-05-11 17:19:04 · 746 阅读 · 0 评论 -
HHU Friendship of Mouse(map)
问题 B: Friendship of Mouse时间限制: 1 Sec 内存限制: 64 MB提交: 24 解决: 15[提交][状态][讨论版]题目描述Today in KBW, N mice from different cities are standing in a line. Each city is represented by a lowercase原创 2016-09-06 19:58:17 · 284 阅读 · 0 评论