![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法学习
文章平均质量分 81
AndreaQ
除非宇宙爆炸,地球毁灭,战争爆发,而你时日无多,否则,一切还来得及!
展开
-
Hie with the Pie POJ - 3311
The Pizazz Pizzeria prides itself in delivering pizzas to its customers as fast as possible. Unfortunately, due to cutbacks, they can afford to hire only one driver to do the deliveries. He will wait for 1 or more (up to 10) orders to be processed before h原创 2021-01-26 15:40:31 · 85 阅读 · 0 评论 -
hdu1238 Substrings
Problem DescriptionYou are given a number of case-sensitive strings of alphabetic characters, find the largest string X, such that either X, or its inverse can be found as a substring of any of th原创 2015-03-18 21:12:34 · 409 阅读 · 0 评论 -
poj 3162 Prime Path
The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices. — It is a matter of s原创 2015-05-02 21:34:33 · 478 阅读 · 0 评论 -
poj 迷宫问题
定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0,};它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横着走或竖着走,不能斜着走,要求编程序找出从左上角到右下角的最短路线。Inpu原创 2015-05-01 19:15:04 · 438 阅读 · 0 评论 -
hdu 3926 Hand in Hand
Problem DescriptionIn order to get rid of Conan, Kaitou KID disguises himself as a teacher in the kindergarten. He knows kids love games and works out a new game called "hand in hand".Initiall原创 2015-06-17 11:03:54 · 651 阅读 · 0 评论 -
HDU 1829 A Bug's Life
Problem DescriptionBackground Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and that they only interact with bug原创 2015-06-16 17:20:23 · 376 阅读 · 0 评论 -
poj 1852 Ants
DescriptionAn army of ants walk on a horizontal pole of length l cm, each with a constant speed of 1 cm/s. When a walking ant reaches an end of the pole, it immediatelly falls off it. When two a原创 2015-06-18 10:27:07 · 535 阅读 · 0 评论 -
poj 3069 Saruman's Army
DescriptionSaruman the White must lead his army along a straight path from Isengard to Helm’s Deep. To keep track of his forces, Saruman distributes seeing stones, known as palantirs, among the tr原创 2015-06-18 23:20:23 · 412 阅读 · 0 评论 -
HDU 1232 畅通工程
畅通工程Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 35747 Accepted Submission(s): 18934Problem Description某省调查城镇交通状况,得到现有城镇道路原创 2015-06-09 10:39:01 · 413 阅读 · 0 评论 -
HDU 1325 Is It A Tree?
Problem DescriptionA tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed edges between nodes satisfying the follow原创 2015-06-09 16:48:42 · 527 阅读 · 0 评论 -
HDU 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-06-11 09:02:34 · 461 阅读 · 0 评论 -
HDU 3172 Virtual Friends
Problem DescriptionThese days, you can do all sorts of things online. For example, you can use various websites to make virtual friends. For some people, growing their social network (their friends,原创 2015-06-14 16:47:55 · 427 阅读 · 0 评论 -
并查集之 Find函数
发现自己写了两道题都把Find函数写得一塌糊涂。。。一题是没有路径压缩过不了,一题是因为前面写错过弄混了,不三不四的。。。总结很重要啊!!路径压缩:递归写法:int Find (int x){ if(Father[x] != x) { Father[x] = Find(Father[x]);//原来写成Father[x] = Father[Father[x]]了。。 //不断地找到其根节点并更改其原创 2015-06-14 16:52:19 · 1452 阅读 · 0 评论 -
hdu 4277 USACO ORZ
Problem DescriptionLike everyone, cows enjoy variety. Their current fancy is new shapes for pastures. The old rectangular shapes are out of favor; new geometries are the favorite.I. M. Hei, the原创 2015-03-22 19:16:13 · 475 阅读 · 0 评论 -
HDU 1213 How Many Tables
Problem DescriptionToday is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the fri原创 2015-03-30 19:19:06 · 561 阅读 · 0 评论 -
hdu 1342
Problem DescriptionIn a Lotto I have ever played, one has to select 6 numbers from the set {1,2,...,49}. A popular strategy to play Lotto - although it doesn't increase your chance of winning - is原创 2015-03-22 09:53:23 · 388 阅读 · 0 评论 -
数塔问题
数塔Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 24591 Accepted Submission(s): 14793Problem Description在讲述DP算法的时候,一个经典的例子就是数塔问原创 2015-01-28 17:10:36 · 963 阅读 · 0 评论 -
poj 1306 combinations
CombinationsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 8745 Accepted: 4064DescriptionComputing the exact number of ways that N things can be taken M原创 2015-01-30 15:52:06 · 739 阅读 · 0 评论 -
10405 - Longest Common Subsequence
Given two sequences of characters, print the length of the longest common subsequence of both sequences. For example, the longest common subsequence of the following two sequences:abcdghaedfhris原创 2015-02-01 01:09:40 · 497 阅读 · 0 评论 -
poj 2533 Longest Ordered Subsequence
Longest Ordered SubsequenceTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 35524 Accepted: 15582DescriptionA numeric sequence of ai is ordered if a1 a2原创 2015-02-03 10:47:54 · 408 阅读 · 0 评论 -
HDU 1950 Bridging signals
Bridging signals Description 'Oh no, they've done it again', cries the chief designer at the Waferland chip factory. Once more the routing designers have screwed up completely, making th原创 2015-02-04 20:56:27 · 514 阅读 · 0 评论 -
HDU 2602 Bone Collector 之01背包
DescriptionMany years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dog’s , cow’s , also he went to the grave … Th原创 2015-02-09 11:03:14 · 450 阅读 · 0 评论 -
动态规划总结之 LIS ,LCS
LIS(Longest Increasing subsequence)含义:一列数中(一般是无序才有研究意义),子序列是递增的(当然也有非下降子序列,递减子序列了,这个就是看子序列的元素间的关系了,>,),要求长度最大的这样的子序列的长度是多少。算法一:O(n*n)1.思路:我们把序列的每个元素都当成递增子序列的最后一个数last(即这个递增子序列的最大的数),用一个数组list[原创 2015-02-14 15:24:08 · 700 阅读 · 0 评论 -
HDU 1114 Piggy-Bank
Problem DescriptionBefore ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Money (IBM). The原创 2015-02-17 16:07:38 · 407 阅读 · 0 评论 -
HDU 2639 Bone Collector II
Problem DescriptionThe title of this problem is familiar,isn't it?yeah,if you had took part in the "Rookie Cup" competition,you must have seem this title.If you haven't seen it before,it doesn't m原创 2015-02-15 23:59:03 · 368 阅读 · 0 评论 -
HDU 2546 饭卡
Problem Description电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大家都希望尽量使卡上的余额最少。某天,食堂中有n种菜出售,每种菜可购买一次。已知每种菜的价格以及卡上的余额,问最少可使卡上的余额为多少。原创 2015-02-16 00:10:12 · 429 阅读 · 0 评论 -
hdu1016 Prime Ring Problem
Problem DescriptionA ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime原创 2015-03-19 21:12:42 · 404 阅读 · 0 评论