摘要: 【题目】 Description Once upon a time there was a greedy King who ordered his chief Architect to build a wall around the King's castle. The King was so gr 阅读全文
posted @ 2016-04-28 19:30 konjak魔芋 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 【题目】 【题目】 Description A bunch of pirates have gotten their hands on a hoard of gold pieces and wish to divide the loot. They are democratic pirates in 阅读全文
posted @ 2016-04-25 13:20 konjak魔芋 阅读(598) 评论(0) 推荐(0) 编辑
摘要: 2016-04-24 15:41:54 阅读全文
posted @ 2016-04-24 15:39 konjak魔芋 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 【题目】 Description Adam and Eve enter this year's ACM International Collegiate Programming Contest. Last night, they played the Calendar Game, in celebr 阅读全文
posted @ 2016-04-24 14:30 konjak魔芋 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 【题目】 Description 有两堆石子,数量任意,可以不同。游戏开始由两个人轮流取石子。游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子;二是可以在两堆中同时取走相同数量的石子。最后把石子全部取完者为胜者。现在给出初始的两堆石子的数目,如果轮到你先取,假设双方都采取最好的 阅读全文
posted @ 2016-04-21 17:06 konjak魔芋 阅读(481) 评论(0) 推荐(0) 编辑
摘要: 【题目】 Description Harry and Sally were playing games at Christmas Eve. They drew some Christmas trees on a paper: Then they took turns to cut a branch 阅读全文
posted @ 2016-04-20 14:08 konjak魔芋 阅读(923) 评论(0) 推荐(0) 编辑
摘要: 【题目】 Description The funny stone game is coming. There are n piles of stones, numbered with 0, 1, 2, ..., n − 1. Twopersons pick stones in turn. In ev 阅读全文
posted @ 2016-04-17 17:11 konjak魔芋 阅读(375) 评论(0) 推荐(0) 编辑
摘要: 【原题在此】 Let us consider a game on a rectangular board m x 1 consisting of m elementary squares numbered successively from 1 to m. There are n pawns on 阅读全文
posted @ 2016-04-16 10:21 konjak魔芋 阅读(433) 评论(0) 推荐(0) 编辑
摘要: 题目: Description In Fuzhou, there is a crazy super man. He can’t fly, but he could jump from housetop to housetop. Today he plans to use N houses to ho 阅读全文
posted @ 2016-04-14 13:49 konjak魔芋 阅读(279) 评论(0) 推荐(0) 编辑
摘要: 题目: Description A supermarket in Tehran is open 24 hours a day every day and needs a number of cashiers to fit its need. The supermarket manager has h 阅读全文
posted @ 2016-04-12 13:50 konjak魔芋 阅读(290) 评论(0) 推荐(0) 编辑
摘要: 题目: Sample Input 5 3 7 3 8 10 3 6 8 1 1 3 1 10 11 1 Sample Input 5 3 7 3 8 10 3 6 8 1 1 3 1 10 11 1 Sample Output 6 Sample Output 6 题意: 我们选数,每个数只能选一次。 阅读全文
posted @ 2016-04-10 16:30 konjak魔芋 阅读(303) 评论(0) 推荐(0) 编辑
摘要: 题目: Sample Input2 11 2 102 11 2 -103 31 2 42 3 23 1 54 52 3 44 2 53 4 23 1 01 2 -1Sample OutputInfiniteInfinite31 题意: 给定一个有向图,每条边都有一个权值。每次你可以选择一个结点v和一 阅读全文
posted @ 2016-04-10 15:32 konjak魔芋 阅读(378) 评论(0) 推荐(0) 编辑
摘要: 题目: Sample Input22 3 4 296 97 199 62Sample Output2 29859 62 题意: 有三个杯子它们的容量分别是a,b,c, 并且初始状态下第一个和第二个是空的, 第三个杯子是满水的。可以把一个杯子的水倒入另一个杯子,当然,当被倒的杯子满了或者倒的杯子水完了 阅读全文
posted @ 2016-04-09 10:12 konjak魔芋 阅读(239) 评论(0) 推荐(0) 编辑
摘要: 题目: Sample Input1a Z19 a Z5A DD XA bb cc X39 A X-1Sample OutputCase 1:20a-ZCase 2:44A-b-c-X 题意: 有两种节点,一种是大写字母,一种是小写字母。首先输入m条边,当经过小写字母时需要付一单位的过路费,当经过大写 阅读全文
posted @ 2016-04-06 13:34 konjak魔芋 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 题目: Sample Input4 6 10001 3 21 4 42 1 32 3 33 4 14 2 2Sample Output28 38 题意: 给出n个节点m条无向边的图,每条边权都为正。令c等于每对结点的最短路长度之和。要求删一条边后使得新的c值c‘最大。不连通两点的最短路长度视为L。( 阅读全文
posted @ 2016-04-05 14:02 konjak魔芋 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 瓶颈生成树 无向图G的一颗瓶颈生成树(bottleneck spanning tree)。T是这样的一颗生成树,它最大的边权值在G的所有生成树中是最小的。瓶颈生成树的值为T中最大权值边的权。 即生成树中最长边最短的树。 无向图的最小生成树一定是瓶颈生成树,但瓶颈生成树不一定是最小生成树。 命题:无向 阅读全文
posted @ 2016-03-31 14:00 konjak魔芋 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 题意: 有n架飞机需要着陆。每架飞机有两种选择,早着陆或者晚着陆,二选其一。现在为了保证飞机的着陆安全,要求两架着陆的飞机的时间间隔的最小值达到最大。 分析: 最小值最大问题我们想到二分答案。对于猜测值x,判断是否有一种方案使相邻两着陆时间都不小于x。 如果两架飞机的某着陆时间差小于p,证明不能同时 阅读全文
posted @ 2016-03-25 13:45 konjak魔芋 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 题意: 有N-1对夫妻参加一个婚宴,所有人都坐在一个长长的餐桌左侧或者右侧,新郎和新娘面做面坐在桌子的两侧。由于新娘的头饰很复杂,她无法看到和她坐在同一侧餐桌的人,只能看到对面餐桌的人。任意一对夫妻不能坐在桌子的同侧,另外有m对人吵过架,而新娘不希望看到两个吵过架的人坐在他的对面,问如何安排这些座位 阅读全文
posted @ 2016-03-24 13:24 konjak魔芋 阅读(373) 评论(0) 推荐(0) 编辑
摘要: 题意: 给你一个无向图,要求把所有无向边改成有向边,并且添加最少的有向边,使得新的有向图强联通。 分析: 这题的解法还是很好想的。先用边双联通分量缩点,然后找新图中入度为0和为1的点,入度为0则ans+2,为1则ans+1,最后输出(ans+1)/2。 注意,如果原图本来就强联通,答案为0不是1。 阅读全文
posted @ 2016-03-23 13:54 konjak魔芋 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 题意: 在Iokh市中,机场快线是市民从市内去机场的首选交通工具。机场快线分为经济线和商业线两种,线路,速度和价钱都不同。你有一张商业线车票,可以坐一站商业线,而其他时候只能乘坐经济线。假设换乘时间忽略不计,你的任务是找一条去机场最快的路线。 分析: 因为商业线只能走一次,我们就枚举走哪条商业线(或 阅读全文
posted @ 2016-03-22 14:01 konjak魔芋 阅读(207) 评论(0) 推荐(0) 编辑