摘要: Submit Status Practice HDU 1301DescriptionThe 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 overtakes roads relentlessly, so the large road network is too expensive to maintain. The 阅读全文
posted @ 2012-03-18 20:19 狸の舞 阅读(175) 评论(0) 推荐(0) 编辑
摘要: DescriptionEddy begins to like painting pictures recently ,he is sure of himself to become a painter.Every day Eddy draws pictures in his small room, and he usually puts out his newest pictures to let his friends appreciate. but the result it can be imagined, the friends are not interested in his pi 阅读全文
posted @ 2012-03-18 20:17 狸の舞 阅读(244) 评论(0) 推荐(0) 编辑
摘要: DescriptionA tree is a well-known data structure that is either empty (, void, nothing) or is a set of one or more nodes connected by directed edges between nodes satisfying the following properties. There is exactly one node, called the root, to which no directed edges point. Every node except the 阅读全文
posted @ 2012-03-18 20:17 狸の舞 阅读(297) 评论(0) 推荐(0) 编辑
摘要: Description上 次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房 间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希望任意两个房间有且仅有一条路径可以相通(除非走 了回头路)。小希现在把她的设计图给你,让你帮忙判断她的设计图是否符合她的设计思路。比如下面的例子,前两个是符合条件的,但是最后一个却有两种方法从 5到达8。 Input输入包含多组数据,每组数据是一个以0 0结尾的整数对列表, 阅读全文
posted @ 2012-03-18 20:16 狸の舞 阅读(190) 评论(0) 推荐(0) 编辑
摘要: Description省 政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。现得到城镇道路统计表,表 中列出了任意两城镇间修建道路的费用,以及该道路是否已经修通的状态。现请你编写程序,计算出全省畅通需要的最低成本。Input测 试输入包含若干测试用例。每个测试用例的第1行给出村庄数目N ( 1< N < 100 );随后的 N(N-1)/2 行对应村庄间道路的成本及修建状态,每行给4个正整数,分别是两个村庄的编号(从1编号到N),此两村庄间道路的成本,以及修建状态:1表示已建,0表示 未建。当N为0时输入结束。O 阅读全文
posted @ 2012-03-18 20:15 狸の舞 阅读(140) 评论(0) 推荐(0) 编辑
摘要: Description相 信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百岛湖,发展 首先要解决的问题当然是交通问题,政府决定实现百岛湖的全畅通!经过考察小组RPRush对百岛湖的情况充分了解后,决定在符合条件的小岛间建上桥,所谓 符合条件,就是2个小岛之间的距离不能小于10米,也不能大于1000米。当然,为了节省资金,只要求实现任意2个小岛之间有路通即可。其中桥的价格为 100元/米。Input输入包括多组数据。输入首先包括一个整数T(T <= 200),代表有T组数据。 每组数据首先是一个整数C(C 阅读全文
posted @ 2012-03-18 20:14 狸の舞 阅读(161) 评论(0) 推荐(0) 编辑
摘要: Description省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。经过调查评估,得到的统计表中列出了有可能建设公路的若干条道路的成本。现请你编写程序,计算出全省畅通需要的最低成本。Input测试输入包含若干测试用例。每个测试用例的第1行给出评估的道路条数 N、村庄数目M ( < 100 );随后的 N 行对应村庄间道路的成本,每行给出一对正整数,分别是两个村庄的编号,以及此两村庄间道路的成本(也是正整数)。为简单起见,村庄从1到M编号。当N为0时,全部输入结束,相应的结果不要输出。Output对每个测试用例,在 阅读全文
posted @ 2012-03-18 20:12 狸の舞 阅读(200) 评论(0) 推荐(0) 编辑
摘要: Description某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路?Input测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( < 1000 )和道路数目M;随后的M行对应M条道路,每行给出一对正整数,分别是该条道路直接连通的两个城镇的编号。为简单起见,城镇从1到N编号。 注意:两个城市之间可以有多条道路相通,也就是说 3 3 1 2 1 2 2 1 这种输入也是合法的 当N 阅读全文
posted @ 2012-03-18 20:11 狸の舞 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Description某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。Input测试输入包含若干测试用例。每个测试用例的第1行给出村庄数目N ( < 100 );随后的N(N-1)/2行对应村庄间的距离,每行给出一对正整数,分别是两个村庄的编号,以及此两村庄间的距离。为简单起见,村庄从1到N编号。 当N为0时,输入结束,该用例不被处理。Output对每个测试用例,在1行里输出最小的公路总长度。Samp 阅读全文
posted @ 2012-03-18 20:05 狸の舞 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 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 friends know each other, and all the friends do not want to stay with strangers.One important rule for this 阅读全文
posted @ 2012-03-18 20:04 狸の舞 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 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.Mr Wang selected a room big enough to hold the boys. The boy who are not been chosen has to leave the room immedia 阅读全文
posted @ 2012-03-18 20:03 狸の舞 阅读(223) 评论(0) 推荐(0) 编辑
摘要: DescriptionStockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformation amongst the stockbrokers to give your employer the tactical edge in the stock market. For maximum effect, you have to spread the rumours in the fastest possible way.Unf 阅读全文
posted @ 2012-03-18 20:01 狸の舞 阅读(146) 评论(0) 推荐(0) 编辑
摘要: DescriptionArbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same currency. For example, suppose that 1 US Dollar buys 0.5 British pound, 1 British pound buys 10.0 French francs, and 1 French franc buys 0.21 US dollar. 阅读全文
posted @ 2012-03-18 20:00 狸の舞 阅读(207) 评论(0) 推荐(0) 编辑
摘要: DescriptionThese are N cities in Spring country. Between each pair of cities there may be one transportation track or none. Now there is some cargo that should be delivered from one city to another. The transportation fee consists of two parts: The cost of the transportation on the path between thes 阅读全文
posted @ 2012-03-18 19:59 狸の舞 阅读(256) 评论(0) 推荐(0) 编辑
摘要: Description虽 然草儿是个路痴(就是在杭电待了一年多,居然还会在校园里迷路的人,汗~),但是草儿仍然很喜欢旅行,因为在旅途中 会遇见很多人(白马王子,^0^),很多事,还能丰富自己的阅历,还可以看美丽的风景……草儿想去很多地方,她想要去东京铁塔看夜景,去威尼斯看电影,去 阳明山上看海芋,去纽约纯粹看雪景,去巴黎喝咖啡写信,去北京探望孟姜女……眼看寒假就快到了,这么一大段时间,可不能浪费啊,一定要给自己好好的放个 假,可是也不能荒废了训练啊,所以草儿决定在要在最短的时间去一个自己想去的地方!因为草儿的家在一个小镇上,没有火车经过,所以她只能去邻近的城市坐火 车(好可怜啊~)。Input 阅读全文
posted @ 2012-03-18 19:59 狸の舞 阅读(162) 评论(0) 推荐(0) 编辑
摘要: View Code 1 #include<stdio.h> 2 #include<string.h> 3 #include<stdlib.h> 4 #define MAX 0xfffffff 5 int map[200][200], visit[200]; 6 long dis[200]; 7 int N, m, s, e; 8 char name[200][40]; 9 10 int find(char str[32])11 {12 int i;13 for( i = 1; i <= m; ++i )14 {15 if(strcmp(name[i], 阅读全文
posted @ 2012-03-18 19:56 狸の舞 阅读(184) 评论(0) 推荐(0) 编辑
摘要: Description在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗?Input输 入包括多组数据。每组数据第一行是两个整数N、M(N<=100,M<=10000),N表示成都的大街上有几个路口,标号为1的路口是商店 所在地,标号为N的路口是赛场所在地,M则表示在成都有几条路。N=M=0表示输入结束。接下来M行,每行包括3个整数A,B,C(1<=A,B& lt;=N,1<=C<=1000),表示在路 阅读全文
posted @ 2012-03-18 19:54 狸の舞 阅读(153) 评论(0) 推荐(0) 编辑