摘要: DescriptionYou are given two pots, having the volume of A and B liters respectively. The following operations can be performed:FILL(i) fill the pot i (1 ≤ i ≤ 2) from the tap;DROP(i) empty the pot ito the drain;POUR(i,j) pour from pot i to pot j; after this operation either the pot j is full (and th 阅读全文
posted @ 2012-03-22 19:27 'wind 阅读(205) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionACboy很喜欢玩一种战略游戏,在一个地图上,有N座城堡,每座城堡都有一定的宝物,在每次游戏中ACboy允许攻克M个城堡并获得里面的宝物。但由于地理位置原因,有些城堡不能直接攻克,要攻克这些城堡必须先攻克其他某一个特定的城堡。你能帮ACboy算出要获得尽量多的宝物应该攻克哪M个城堡吗?Input每个测试实例首先包括2个整数,N,M.(1 <= M <= N <= 200);在接下来的N行里,每行包括2个整数,a,b. 在第 i 行,a 代表要攻克第 i 个城堡必须先攻克第 a 个城堡,如果 a = 0 则代表可以直接攻克第 i 个城堡。b 阅读全文
posted @ 2012-03-22 17:44 'wind 阅读(306) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionThere is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure of employees. It means that the supervisor relation forms a tree rooted at the rector V. E. Tretyakov. In order to make the party funny for eve 阅读全文
posted @ 2012-03-22 00:10 'wind 阅读(376) 评论(0) 推荐(0) 编辑