上一页 1 2 3 4 5 6 7 8 ··· 13 下一页
摘要: 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) 编辑
摘要: Description虽 然草儿是个路痴(就是在杭电待了一年多,居然还会在校园里迷路的人,汗~),但是草儿仍然很喜欢旅行,因为在旅途中 会遇见很多人(白马王子,^0^),很多事,还能丰富自己的阅历,还可以看美丽的风景……草儿想去很多地方,她想要去东京铁塔看夜景,去威尼斯看电影,去 阳明山上看海芋,去纽约纯粹看雪景,去巴黎喝咖啡写信,去北京探望孟姜女……眼看寒假就快到了,这么一大段时间,可不能浪费啊,一定要给自己好好的放个 假,可是也不能荒废了训练啊,所以草儿决定在要在最短的时间去一个自己想去的地方!因为草儿的家在一个小镇上,没有火车经过,所以她只能去邻近的城市坐火 车(好可怜啊~)。Input 阅读全文
posted @ 2012-03-18 19:59 狸の舞 阅读(162) 评论(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) 编辑
摘要: 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) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 13 下一页