摘要: 题目连接https://leetcode.com/problems/word-pattern/Word PatternDescriptionGiven a pattern and a string str, find if str follows the same pattern.Here foll... 阅读全文
posted @ 2015-12-04 21:30 GadyPu 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 题目连接https://leetcode.com/problems/count-and-say/Count and SayDescriptionThe count-and-say sequence is the sequence of integers beginning as follows:1,... 阅读全文
posted @ 2015-12-04 21:22 GadyPu 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 题目连接 https://leetcode.com/problems/super-ugly-number/ Super Ugly Number Description Write a program to find the $n^{th}$ super ugly number. Super ugly 阅读全文
posted @ 2015-12-03 22:04 GadyPu 阅读(544) 评论(0) 推荐(0) 编辑
摘要: 题目连接https://leetcode.com/problems/find-median-from-data-stream/Find Median from Data StreamDescriptionMedian is the middle value in an ordered integer... 阅读全文
posted @ 2015-12-01 20:13 GadyPu 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 题目连接https://leetcode.com/problems/remove-invalid-parentheses/Remove Invalid ParenthesesDescriptionRemove the minimum number of invalid parentheses in ... 阅读全文
posted @ 2015-12-01 20:06 GadyPu 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 题目连接https://leetcode.com/problems/range-sum-query-immutable/Range Sum Query - ImmutableDescriptionGiven an integer arraynums, find the sum of the elem... 阅读全文
posted @ 2015-12-01 19:59 GadyPu 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 题目连接https://leetcode.com/problems/range-sum-query-mutable/Range Sum Query - MutableDescriptionGiven an integer arraynums, find the sum of the elements... 阅读全文
posted @ 2015-12-01 19:55 GadyPu 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 题目连接https://leetcode.com/problems/minimum-height-trees/Minimum Height TreesDescriptionFor a undirected graph with tree characteristics, we can choose ... 阅读全文
posted @ 2015-12-01 19:46 GadyPu 阅读(320) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://acm.hdu.edu.cn/showproblem.php?pid=3836Equivalent SetsDescriptionTo prove two sets A and B are equivalent, we can first prove A is a subset... 阅读全文
posted @ 2015-11-28 21:07 GadyPu 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1269迷宫城堡Description为了训练小希的方向感,Gardon建立了一座大城堡,里面有N个房间(Nusing namespace std;const int N = 10100;struct Tar... 阅读全文
posted @ 2015-11-26 21:36 GadyPu 阅读(420) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://acm.hdu.edu.cn/showproblem.php?pid=2586How far away ?DescriptionThere are n houses in the village and some bidirectional roads connecting t... 阅读全文
posted @ 2015-11-24 21:11 GadyPu 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://poj.org/problem?id=1330Nearest Common AncestorsDescriptionA rooted tree is a well-known data structure in computer science and engineering.... 阅读全文
posted @ 2015-11-24 21:07 GadyPu 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://poj.org/problem?id=1564Sum It UpDescriptionGiven a specified total t and a list of n integers, find all distinct sums using numbers from th... 阅读全文
posted @ 2015-10-25 20:17 GadyPu 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1427速算24点Description速算24点相信绝大多数人都玩过。就是随机给你四张牌,包括A(1),2,3,4,5,6,7,8,9,10,J(11),Q(12),K(13)。要求只用'+','-','*... 阅读全文
posted @ 2015-10-20 17:25 GadyPu 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://acm.hdu.edu.cn/showproblem.php?pid=2660Accepted NecklaceDescriptionI have N precious stones, and plan to use K of them to make a necklace f... 阅读全文
posted @ 2015-10-18 14:16 GadyPu 阅读(283) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://poj.org/problem?id=3253Fence RepairDescriptionFarmer John wants to repair a small length of the fence around the pasture. He measures the f... 阅读全文
posted @ 2015-10-13 22:21 GadyPu 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://poj.org/problem?id=27854 Values whose Sum is 0DescriptionThe SUM problem can be formulated as follows: given four lists A, B, C, D of integ... 阅读全文
posted @ 2015-10-10 21:35 GadyPu 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://poj.org/problem?id=2777Count ColorDescriptionChosen Problem Solving and Program design as an optional course, you are required to solve all... 阅读全文
posted @ 2015-10-10 16:11 GadyPu 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1053EntropyDescriptionAn entropy encoder is a data encoding method that achieves lossless data compressi... 阅读全文
posted @ 2015-10-09 20:28 GadyPu 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://acm.hdu.edu.cn/showproblem.php?pid=5444Elven PostmanDescriptionElves are very peculiar creatures. As we all know, they can live for a very ... 阅读全文
posted @ 2015-09-16 21:11 GadyPu 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://acm.hdu.edu.cn/showproblem.php?pid=5443The Water ProblemDescriptionIn Land waterless, water is a very limited resource. People always fight... 阅读全文
posted @ 2015-09-16 21:01 GadyPu 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1237简单计算器Description读入一个只包含 +, -, *, / 的非负整数计算表达式,计算该表达式的值。Input测试输入包含若干测试用例,每个测试用例占一行,每行不超过200个字符,整数和运算... 阅读全文
posted @ 2015-09-15 19:31 GadyPu 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://acm.hdu.edu.cn/showproblem.php?pid=5412CRB and QueriesDescriptionThere are $N$ boys in CodeLand. Boy i has his coding skill $A_{i}$. CRB wa... 阅读全文
posted @ 2015-09-09 23:13 GadyPu 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://acm.hdu.edu.cn/showproblem.php?pid=5349MZL's simple problemDescriptionA simple problemProblem DescriptionYou have a multiple set,and now th... 阅读全文
posted @ 2015-09-09 23:03 GadyPu 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://acm.hdu.edu.cn/showproblem.php?pid=5327OlympiadDescriptionYou are one of the competitors of the Olympiad in numbers. The problem of this ye... 阅读全文
posted @ 2015-09-09 22:56 GadyPu 阅读(327) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://acm.hdu.edu.cn/showproblem.php?pid=5311Hidden StringDescriptionToday is the 1st anniversary of BestCoder. Soda, the contest manager, gets a... 阅读全文
posted @ 2015-09-09 22:49 GadyPu 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://acm.hdu.edu.cn/showproblem.php?pid=5253连接的管道Description老 Jack 有一片农田,以往几年都是靠天吃饭的。但是今年老天格外的不开眼,大旱。所以老 Jack 决定用管道将他的所有相邻的农田全部都串联起来,这样他就可以从远处引水... 阅读全文
posted @ 2015-09-09 22:40 GadyPu 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://acm.hdu.edu.cn/showproblem.php?pid=5166Missing numberDescriptionThere is a permutation without two numbers in it, and now you know what num... 阅读全文
posted @ 2015-09-09 22:34 GadyPu 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://acm.hdu.edu.cn/showproblem.php?pid=4715Difference Between PrimesDescriptionAll you know Goldbach conjecture.That is to say, Every even inte... 阅读全文
posted @ 2015-09-08 21:32 GadyPu 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://acm.hdu.edu.cn/showproblem.php?pid=4707PetDescriptionOne day, Lin Ji wake up in the morning and found that his pethamster escaped. He searc... 阅读全文
posted @ 2015-09-08 21:27 GadyPu 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://acm.hdu.edu.cn/showproblem.php?pid=4593RobotDescriptionA robot is a mechanical or virtual artificial agent, usually an electro-mechanical m... 阅读全文
posted @ 2015-09-08 21:23 GadyPu 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://acm.hdu.edu.cn/showproblem.php?pid=4334TroubleDescriptionHassan is in trouble. His mathematics teacher has given him a very difficult probl... 阅读全文
posted @ 2015-09-08 21:19 GadyPu 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://acm.hdu.edu.cn/showproblem.php?pid=4324Triangle LOVEDescriptionRecently, scientists find that there is love between any of two people. For ... 阅读全文
posted @ 2015-09-08 21:15 GadyPu 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://acm.hdu.edu.cn/showproblem.php?pid=4255A Famous GridDescriptionMr. B has recently discovered the grid named "spiral grid".Construct the gri... 阅读全文
posted @ 2015-09-08 21:11 GadyPu 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://acm.hdu.edu.cn/showproblem.php?pid=3549Flow ProblemDescriptionNetwork flow is a well-known difficult problem for ACMers. Given a graph, you... 阅读全文
posted @ 2015-09-08 21:07 GadyPu 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://acm.hdu.edu.cn/showproblem.php?pid=3371Connect the CitiesDescriptionIn 2100, since the sea level rise, most of the cities disappear. Though... 阅读全文
posted @ 2015-09-08 21:02 GadyPu 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://acm.hdu.edu.cn/showproblem.php?pid=2846RepositoryDescriptionWhen you go shopping, you can search in repository for avalible merchandises by... 阅读全文
posted @ 2015-09-08 20:53 GadyPu 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://acm.hdu.edu.cn/showproblem.php?pid=2120Ice_cream's world IDescriptionice_cream's world is a rich country, it has many fertile lands. Today,... 阅读全文
posted @ 2015-09-08 20:08 GadyPu 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://acm.hdu.edu.cn/showproblem.php?pid=2095hdu 2095 find your present (2)DescriptionIn the new year party, everybody will get a "special presen... 阅读全文
posted @ 2015-09-08 19:59 GadyPu 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://acm.hdu.edu.cn/showproblem.php?pid=2035人见人爱A^BDescription求A^B的最后三位数表示的整数。说明:A^B的含义是“A的B次方”Input输入数据包含多个测试实例,每个实例占一行,由两个正整数A和B组成(1#include#i... 阅读全文
posted @ 2015-09-08 19:52 GadyPu 阅读(200) 评论(0) 推荐(0) 编辑