2011年3月19日
摘要: URL:http://poj.org/problem?id=3662——problem:一个无向图有n个点, p条边, 每边有花费, 可以任意指定有k条边免费, 现要求选择若干条边构成顶点1到顶点n的一条路径, 使得路径上边权最大值(不包括免费边)最小.——solution:二分答案,最短路假设A是可行解,即路径上边权最大值为A,则该路径上边权大于A的边一定小于等于K条。若A不是最优解,那么必然B<A,是的路径上边权大于B的边小于等于K。于是我们可以二分答案,得到一个值X,将所有小于等于X的边变为0,大于X的边变为1。做最短路,则1到N的距离就是所用权值大于X边的条数。如果小于等于K,则 阅读全文
posted @ 2011-03-19 21:18 风也轻云也淡 阅读(340) 评论(0) 推荐(0) 编辑
摘要: ——url:http://acm.hdu.edu.cn/showproblem.php?pid=2992——problem: 有n(≤10000)个地点, m(≤100000)条无向边, 其中有h个地点建有旅馆, 一个人从1出发去n, 此人每天最多走10小时, 然后就要进旅馆休息, 第二天继续走, 直到到达n, 问最少需要预定多少家旅馆(最少需要多少天)可以到达n, 若不能到达则输出-1.——solution: h次Dijkstra求出旅馆间最短路, 然后重新建图再做一次最短路。把起点和终点也当做旅馆。对每个旅馆做次最短路,如果两个旅馆之间的时间<=600,那么这两个旅馆能隔天到达,重新 阅读全文
posted @ 2011-03-19 19:31 风也轻云也淡 阅读(451) 评论(0) 推荐(0) 编辑
  2011年3月10日
摘要: 【JSOI2008】最小生成树计数Description 现在给出了一个简单无向加权图。你不满足于求出这个图的最小生成树,而希望知道这个图中有多少个不同的最小生成树。(如果两颗最小生成树中至少有一条边不同,则这两个最小生成树就是不同的)。由于不同的最小生成树可能很多,所以你只需要输出方案数对31011的模就可以了。Input 第一行包含两个数,n和m,其中1<=n<=100; 1<=m<=1000; 表示该无向图的节点数和边数。每个节点用1~n的整数编号。 接下来的m行,每行包含两个整数:a, b, c,表示节点a, b之间的边的权值为c,其中1<=c<=1 阅读全文
posted @ 2011-03-10 15:55 风也轻云也淡 阅读(1104) 评论(0) 推荐(0) 编辑
  2011年3月3日
摘要: National TreasuresTime Limit: 6000MSMemory Limit: 65536KTotal Submits: 35Accepted: 11DescriptionThe great hall of the national museum has been robbed few times recently. Everyone is now worried about the security of the treasures on display. To help secure the hall, the museum contracted with a priv 阅读全文
posted @ 2011-03-03 20:29 风也轻云也淡 阅读(220) 评论(0) 推荐(0) 编辑
摘要: Triangular PasturesTime Limit: 1500MSMemory Limit: 45000KCase Time Limit: 1000MSTotal Submits: 31Accepted: 5DescriptionLike 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 lead c 阅读全文
posted @ 2011-03-03 20:20 风也轻云也淡 阅读(313) 评论(0) 推荐(0) 编辑
摘要: Quick AnswerTime Limit: 1000MSMemory Limit: 65536KTotal Submits: 86Accepted: 12DescriptionJoe is fond of computer games. Now, he must solve a puzzling situation. In front of his eyes lies a huge map with fortified towns. His enemy is a very powerful and tricky character who can connect and disconnec 阅读全文
posted @ 2011-03-03 20:14 风也轻云也淡 阅读(267) 评论(0) 推荐(0) 编辑
  2011年2月17日
摘要: Mountain RoadTime Limit: 10000MSMemory Limit: 65536KTotal Submits: 21Accepted: 8DescriptionIn the Franconian Switzerland, there is a narrow mountain road. With only a single lane, this is a bottleneck for two-way traffic. Your job is to schedule incoming cars at both ends so that the last car leaves 阅读全文
posted @ 2011-02-17 19:55 风也轻云也淡 阅读(207) 评论(0) 推荐(0) 编辑
摘要: Circle ArtworkTime Limit: 1000MSMemory Limit: 65536KTotal Submits: 48Accepted: 6DescriptionCircle is an ancient and universal symbol of unity, wholeness, infinity, the goddess, and female power. It is referenced frequently in religion and art. In this problem, we act as a modern artist and would lik 阅读全文
posted @ 2011-02-17 19:10 风也轻云也淡 阅读(189) 评论(0) 推荐(0) 编辑
  2011年2月5日
摘要: Cleaning ShiftsTime Limit: 1000MSMemory Limit: 65536KTotal Submits: 75Accepted: 29DescriptionFarmer John's cows, pampered since birth, have reached new heights of fastidiousness. They now require their barn to be immaculate. Farmer John, the most obliging of farmers, has no choice but hire some 阅读全文
posted @ 2011-02-05 21:07 风也轻云也淡 阅读(250) 评论(0) 推荐(0) 编辑
  2011年2月4日
摘要: Moo University - Financial AidTime Limit: 1000MSMemory Limit: 65536KTotal Submits: 72Accepted: 13DescriptionBessie noted that although humans have many universities they can attend, cows have none. To remedy this problem, she and her fellow cows formed a new university called The University of Wisco 阅读全文
posted @ 2011-02-04 20:48 风也轻云也淡 阅读(169) 评论(0) 推荐(0) 编辑