算法
不为自己找借口
且随疾风前行,身后亦须留心。
展开
-
poj 1458 Common Subsequence(lcs模板)
DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequence Z = is a subsequence of X if there exists a st原创 2015-08-10 17:58:25 · 318 阅读 · 0 评论 -
杭电 1503 Advanced Fruits(lcs)
Advanced FruitsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2047 Accepted Submission(s): 1050Special JudgeProblem DescriptionT原创 2015-08-11 10:20:32 · 303 阅读 · 0 评论 -
杭电 1513 Palindrome(LCS)
A palindrome is a symmetrical string, that is, a string read identically from left to right as well as from right to left. You are to write a program which, given a string, determines the minimal numb原创 2015-08-10 20:28:41 · 297 阅读 · 0 评论 -
杭电 1301 junjle road(最小生成树)
Problem DescriptionThe Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ago. But the jungle overt原创 2015-08-13 20:55:26 · 276 阅读 · 0 评论 -
杭电 2120 ice cream‘s word
Problem Descriptionice_cream's world is a rich country, it has many fertile lands. Today, the queen of ice_cream wants award land to diligent ACMers. So there are some watchtowers are set up, and wa原创 2015-07-29 21:08:45 · 382 阅读 · 0 评论 -
杭电 2025 查找最大元素
Problem Description对于输入的每个字符串,查找其中的最大字母,在该字母后面插入字符串“(max)”。 Input输入数据包括多个测试实例,每个实例由一行长度不超过100的字符串组成,字符串仅由大小写字母构成。 Output对于每个测试实例输出一行字符串,输出的结果是插入字符串“(max)”后的结果,如果存在多个最大的字母,就在每一个最大原创 2015-07-28 20:59:41 · 318 阅读 · 0 评论 -
并查集
并查集是我暑假从高手那里学到的一招,觉得真是太精妙的设计了。以前我无法解决的一类问题竟然可以用如此简单高效的方法搞定。不分享出来真是对不起party了。(party:我靠,关我嘛事啊?我跟你很熟么?)来看一个实例,杭电1232畅通工程首先在地图上给你若干个城镇,这些城镇都可以看作点,然后告诉你哪些对城镇之间是有道路直接相连的。最后要解决的是整幅图的连通性问题。比如随意给你两个点,让你判转载 2015-07-29 21:15:57 · 292 阅读 · 0 评论 -
杭电 1856 more is better
Problem DescriptionMr Wang wants some boys to help him with a project. Because the project is rather complex,the more boys come, the better it will be. Of course there are certain requirements.原创 2015-07-29 21:12:33 · 395 阅读 · 0 评论 -
杭电 1272 小希的迷宫
Problem Description上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希望任意两个房间有且仅有一条路径可以相通(除非走了回头路)。原创 2015-07-29 21:11:40 · 334 阅读 · 0 评论