上一页 1 ··· 19 20 21 22 23
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2545Problem Description给一棵树,如果树上的某个节点被某个人占据,则它的所有儿子都被占据,lxh和pfz初始时分别站在两个节点上,谁当前所在的点被另一个人占据,他就输了比赛,问谁能获胜Input输入包含多组数据每组第一行包含两个数N,M(N,M<=100000),N表示树的节点数,M表示询问数,N=M=0表示输入结束。节点的编号为1到N。接下来N-1行,每行2个整数A,B(1<=A,B<=N),表示编号为A的节点是编号为B的节点的父亲接下来M行,每行有2个数,表示lxh和 阅读全文
posted @ 2012-08-21 22:31 crazy_apple 阅读(554) 评论(0) 推荐(1) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1598Problem DescriptionXX星有许多城市,城市之间通过一种奇怪的高速公路SARS(Super Air Roam Structure---超级空中漫游结构)进行交流,每条SARS都对行驶在上面的Flycar限制了固定的Speed,同时XX星人对 Flycar的“舒适度”有特殊要求,即乘坐过程中最高速度与最低速度的差越小乘坐越舒服 ,(理解为SARS的限速要求,flycar必须瞬间提速/降速,痛苦呀 ),但XX星人对时间却没那么多要求。要你找出一条城市间的最舒适的路径。(SARS是双向的)。I 阅读全文
posted @ 2012-08-20 22:23 crazy_apple 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 转自:http://www.cnblogs.com/Mu-Tou/archive/2011/08/11/2135405.html要学习匈牙利算法先要懂得二部图的各种概念。。下面给出由o(∩_∩)o MiYu 总结的一般性概念,这些概念很重要,一定要懂。。二分图的基本概念: ( 意思就是所有的点分成了2个集合 x, y. 每个集合中的顶点相互间没有边 )一个无向图 G = < V, E >, 如果存在两个集合X, Y, 使得X∪Y=V, X∩Y=Φ, 并且每一条边e={x, y}有x∈X,y∈Y, 则称G为一个二分图(bipartite graph). 常用来表示一个二分图. 若对X 阅读全文
posted @ 2012-08-20 16:16 crazy_apple 阅读(325) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1597Problem Description假设:S1 = 1S2 = 12S3 = 123S4 = 1234.........S9 = 123456789S10 = 1234567891S11 = 12345678912............S18 = 123456789123456789..................现在我们把所有的串连接起来S = 1121231234.......123456789123456789112345678912.........那么你能告诉我在S串中的第N个数字是多 阅读全文
posted @ 2012-08-20 11:42 crazy_apple 阅读(222) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionXX星球有很多城市,每个城市之间有一条或多条飞行通道,但是并不是所有的路都是很安全的,每一条路有一个安全系数s,s是在 0 和 1 间的实数(包括0,1),一条从u 到 v 的通道P 的安全度为Safe(P) = s(e1)*s(e2)…*s(ek) e1,e2,ek是P 上的边 ,现在8600 想出去旅游,面对这这么多的路,他想找一条最安全的路。但是8600 的数学不好,想请你帮忙 ^_^Input输入包括多个测试实例,每个实例包括:第一行:n。n表示城市的个数n<=1000;接着是一个n*n的矩阵表示两个城市之间的安全系数,(0可以理解为那两个城 阅读全文
posted @ 2012-08-20 11:35 crazy_apple 阅读(151) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1281Problem Description小希和Gardon在玩一个游戏:对一个N*M的棋盘,在格子里放尽量多的一些国际象棋里面的“车”,并且使得他们不能互相攻击,这当然很简单,但是Gardon限制了只有某些格子才可以放,小希还是很轻松的解决了这个问题(见下图)注意不能放车的地方不影响车的互相攻击。 所以现在Gardon想让小希来解决一个更难的问题,在保证尽量多的“车”的前提下,棋盘里有些格子是可以避开的,也就是说,不在这些格子上放车,也可以保证尽量多的“车”被放下。但是某些格子若不放子,就无法保证放尽量多 阅读全文
posted @ 2012-08-20 11:06 crazy_apple 阅读(268) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1258Problem DescriptionGiven a specified total t and a list of n integers, find all distinct sums using numbers from the list that add up to t. For example, if t=4, n=6, and the list is [4,3,2,2,1,1], then there are four different sums that equal 4: 4,3+1,2+ 阅读全文
posted @ 2012-08-19 10:25 crazy_apple 阅读(162) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1301Problem DescriptionThe 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 expe 阅读全文
posted @ 2012-08-18 14:17 crazy_apple 阅读(194) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1217Problem 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 阅读全文
posted @ 2012-08-18 13:26 crazy_apple 阅读(147) 评论(0) 推荐(0) 编辑
摘要: Problem 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 i 阅读全文
posted @ 2012-08-17 00:10 crazy_apple 阅读(230) 评论(0) 推荐(0) 编辑
上一页 1 ··· 19 20 21 22 23