摘要:
DescriptionBessie wants to navigate her spaceship through a dangerous asteroid field in the shape of an N x N grid (1 <= N <= 500). The grid contains K asteroids (1 <= K <= 10,000), which are conveniently located at the lattice points of the grid. Fortunately, Bessie has a powerful weapo 阅读全文
posted @ 2012-07-31 23:23
crying_Dream
阅读(157)
评论(0)
推荐(0)
摘要:
DescriptionConsider a group of N students and P courses. Each student visits zero, one or more than one courses. Your task is to determine whether it is possible to form a committee of exactly P students that satisfies simultaneously the conditions: every student in the committee represents a differ 阅读全文
posted @ 2012-07-31 23:19
crying_Dream
阅读(172)
评论(0)
推荐(0)
摘要:
Problem DescriptionA group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building, and at the mean time, provide the monkey with some blocks. If the monkey is clever enough, it shall be able to reach the banana by placing one block on 阅读全文
posted @ 2012-07-31 18:56
crying_Dream
阅读(187)
评论(0)
推荐(0)
摘要:
Problem DescriptionNow I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challenge ourselves to more difficult problems. Now you are faced with a more difficult problem.Given a consecutive number sequence S1, S2, S3, S4 ... Sx, ... Sn (1 ≤ x ≤ 阅读全文
posted @ 2012-07-31 18:53
crying_Dream
阅读(234)
评论(0)
推荐(0)
摘要:
Problem DescriptionGiven three strings, you are to determine whether the third string can be formed by combining the characters in the first two strings. The first two strings can be mixed arbitrarily, but each must stay in its original order.For example, consider forming "tcraete" from &q 阅读全文
posted @ 2012-07-31 18:51
crying_Dream
阅读(165)
评论(0)
推荐(0)
摘要:
Problem DescriptionFatMouse has stored some cheese in a city. The city can be considered as a square grid of dimension n: each grid location is labelled (p,q) where 0 <= p < n and 0 <= q < n. At each grid location Fatmouse has hid between 0 and 100 blocks of cheese in a hole. Now he' 阅读全文
posted @ 2012-07-31 18:48
crying_Dream
阅读(198)
评论(0)
推荐(0)
摘要:
DescriptionAfter Farmer John realized that Bessie had installed a "tree-shaped" network among his N (1 <= N <= 10,000) barns at an incredible cost, he sued Bessie to mitigate his losses. Bessie, feeling vindictive, decided to sabotage Farmer John's network by cutting power to one 阅读全文
posted @ 2012-07-31 18:44
crying_Dream
阅读(250)
评论(0)
推荐(0)
摘要:
DescriptionLast years Chicago was full of gangster fights and strange murders. The chief of the police got really tired of all these crimes, and decided to arrest the mafia leaders.Unfortunately, the structure of Chicago mafia is rather complicated. There are n persons known to be related to mafia. 阅读全文
posted @ 2012-07-31 18:41
crying_Dream
阅读(405)
评论(0)
推荐(0)
摘要:
DescriptionConsider a tree T with N (1 <= N <= 20,000) nodes numbered 1...N. Deleting any node from the tree yields a forest: a collection of one or more trees. Define the balance of a node to be the size of the largest tree in the forest T created by deleting that node from T. For example, co 阅读全文
posted @ 2012-07-31 18:39
crying_Dream
阅读(171)
评论(0)
推荐(0)
摘要:
DescriptionBob enjoys playing computer games, especially strategic games, but sometimes he cannot find the solution fast enough and then he is very sad. Now he has the following problem. He must defend a medieval city, the roads of which form a tree. He has to put the minimum number of soldiers on t 阅读全文
posted @ 2012-07-31 18:33
crying_Dream
阅读(187)
评论(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-07-31 18:31
crying_Dream
阅读(162)
评论(0)
推荐(0)
摘要:
DescriptionGiven a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1*1 or greater located within the whole array. The sum of a rectangle is the sum of all the elements in that rectangle. In this problem the sub-rectangle with the largest s 阅读全文
posted @ 2012-07-31 18:28
crying_Dream
阅读(153)
评论(0)
推荐(0)
摘要:
Problem DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 + 4 = 14.InputThe first line of the input contains an integer T(1<=T<=20) which means the number 阅读全文
posted @ 2012-07-31 18:26
crying_Dream
阅读(212)
评论(0)
推荐(0)
摘要:
Problem DescriptionBob is a strategy game programming specialist. In his new city building game the gaming environment is as follows: a city is built up by areas, in which there are streets, trees,factories and buildings. There is still some space in the area that is unoccupied. The strategic task o 阅读全文
posted @ 2012-07-31 15:49
crying_Dream
阅读(240)
评论(0)
推荐(0)
摘要:
Problem DescriptionA histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have different heights. For example, the figure on the left shows the histogram that consists of rectangles with the heights 2, 1, 4, 5, 1, 3, 3, m 阅读全文
posted @ 2012-07-31 15:47
crying_Dream
阅读(279)
评论(0)
推荐(0)
摘要:
Problem DescriptionNew semester is coming, and DuoDuo has to go to school tomorrow. She decides to have fun tonight and will be very busy after tonight. She like watch cartoon very much. So she wants her uncle to buy some movies and watch with her tonight. Her grandfather gave them L minutes to watc 阅读全文
posted @ 2012-07-31 15:43
crying_Dream
阅读(236)
评论(0)
推荐(0)
摘要:
Problem Description最近xhd正在玩一款叫做FATE的游戏,为了得到极品装备,xhd在不停的杀怪做任务。久而久之xhd开始对杀怪产生的厌恶感,但又不得不通过杀怪来升完这最后一级。现在的问题是,xhd升掉最后一级还需n的经验值,xhd还留有m的忍耐度,每杀一个怪xhd会得到相应的经验,并减掉相应的忍耐度。当忍耐度降到0或者0以下时,xhd就不会玩这游戏。xhd还说了他最多只杀s只怪。请问他能升掉这最后一级吗?Input输入数据有多组,对于每组数据第一行输入n,m,k,s(0 < n,m,k,s < 100)四个正整数。分别表示还需的经验值,保留的忍耐度,怪的种数和最 阅读全文
posted @ 2012-07-31 15:39
crying_Dream
阅读(197)
评论(0)
推荐(0)
摘要:
Problem DescriptionMarsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the marbles. This would be easy if all the marbles had the same value, because then they could just split the collection in half. But unfortunatel 阅读全文
posted @ 2012-07-31 15:34
crying_Dream
阅读(193)
评论(0)
推荐(0)
摘要:
Problem Description急!灾区的食物依然短缺!为了挽救灾区同胞的生命,心系灾区同胞的你准备自己采购一些粮食支援灾区,现在假设你一共有资金n元,而市场有m种大米,每种大米都是袋装产品,其价格不等,并且只能整袋购买。请问:你用有限的资金最多能采购多少公斤粮食呢?后记:人生是一个充满了变数的生命过程,天灾、人祸、病痛是我们生命历程中不可预知的威胁。月有阴晴圆缺,人有旦夕祸福,未来对于我们而言是一个未知数。那么,我们要做的就应该是珍惜现在,感恩生活——感谢父母,他们给予我们生命,抚养我们成人;感谢老师,他们授给我们知识,教我们做人感谢朋友,他们让我们感受到世界的温暖;感谢对手,他们令我 阅读全文
posted @ 2012-07-31 15:26
crying_Dream
阅读(171)
评论(0)
推荐(0)
摘要:
DescriptionJohn never knew he had a grand-uncle, until he received the notary's letter. He learned that his late grand-uncle had gathered a lot of money, somewhere in South-America, and that John was the only inheritor. John did not need that much money for the moment. But he realized that it wo 阅读全文
posted @ 2012-07-31 15:23
crying_Dream
阅读(196)
评论(0)
推荐(0)
摘要:
DescriptionBessie has gone to the mall's jewelry store and spies a charm bracelet. Of course, she'd like to fill it with the best charms possible from the N (1 ≤ N ≤ 3,402) available charms. Each charm i in the supplied list has a weight Wi (1 ≤ Wi ≤ 400), a 'desirability' factor Di 阅读全文
posted @ 2012-07-31 15:16
crying_Dream
阅读(155)
评论(0)
推荐(0)
摘要:
DescriptionGigel has a strange "balance" and he wants to poise it. Actually, the device is different from any other ordinary balance.It orders two arms of negligible weight and each arm's length is 15. Some hooks are attached to these arms and Gigel wants to hang up some weights from h 阅读全文
posted @ 2012-07-31 15:08
crying_Dream
阅读(193)
评论(0)
推荐(0)
摘要:
Description给定两个字符串,输出他们的最长公共子序列,要求字典序最小。Input有多组数据,每组数据包含两行,每行一个字符串,每个字符串的长度不超过1000。每个字符串仅包含小写字母。Output对于每组数据,输出一行,字典序最小的公共子序列。Sample InputabcdefghaaaabcdefghbbboxuhiehozuoxuhijednrehozujudgzSample Outputabcdefghououjd思路:和上一道题很像,但是再求最长公共子序列的时候应该倒着求,从最小字符'a'枚举但是在枚举时是从最后一个开始的所以就逆序过来操作。代码如下:#in 阅读全文
posted @ 2012-07-31 15:04
crying_Dream
阅读(804)
评论(1)
推荐(0)
摘要:
DescriptionAlice and Bob want to go on holiday. Each of them has planned a route, which is a list of cities to be visited in a given order. A route may contain a city more than once.As they want to travel together, they have to agree on a common route. None wants to change the order of the cities on 阅读全文
posted @ 2012-07-31 15:00
crying_Dream
阅读(605)
评论(0)
推荐(0)
摘要:
Description在河上有一座独木桥,一只青蛙想沿着独木桥从河的一侧跳到另一侧。在桥上有一些石子,青蛙很讨厌踩在这些石子上。由于桥的长度和青蛙一次跳过的距离都是正整数,我们可以把独木桥上青蛙可能到达的点看成数轴上的一串整点:0,1,……,L(其中L是桥的长度)。坐标为0的点表示桥的起点,坐标为L的点表示桥的终点。青蛙从桥的起点开始,不停的向终点方向跳跃。一次跳跃的距离是S到T之间的任意正整数(包括S,T)。当青蛙跳到或跳过坐标为L的点时,就算青蛙已经跳出了独木桥。题目给出独木桥的长度L,青蛙跳跃的距离范围S,T,桥上石子的位置。你的任务是确定青蛙要想过河,最少需要踩到的石子数。Input有 阅读全文
posted @ 2012-07-31 14:50
crying_Dream
阅读(305)
评论(0)
推荐(0)
摘要:
Description大四的教主们毕业了。虽然是教主,但是毕业前都得拿出毕业设计才能得到学士学位,正式毕业。毕业设计文档的排版有严格要求,排版上不能有一点错误,哪怕已经打印了,也要再修改文档重新打印,所以文档必须排版良好,整齐美观。然后就有了如下求“整齐度”的简化的题目:假设正文是n个长度分别为L1、L2、……、Ln(以字符个数度量,不计空白子字符)的单词构成的序列。我们希望将这个段落在一些行上整齐地打印出来,每行至多M个字符。“整齐度”的标准如下:如果某一行包含从i到j的单词(i<j),且单词之间只留一个空格,则在行末多余的空格字符个数为 M - (j-i) - (Li+ …… + L 阅读全文
posted @ 2012-07-31 14:44
crying_Dream
阅读(950)
评论(0)
推荐(0)
摘要:
Language:DivisibilityTime Limit:1000MSMemory Limit:10000KTotal Submissions:8396Accepted:2909DescriptionConsider an arbitrary sequence of integers. One can place + or - operators between integers in the sequence, thus deriving different arithmetical expressions that evaluate to different values. Let 阅读全文
posted @ 2012-07-31 14:40
crying_Dream
阅读(302)
评论(0)
推荐(0)
摘要:
Problem DescriptionYou, the leader of Starship Troopers, are sent to destroy a base of the bugs. The base is built underground. It is actually a huge cavern, which consists of many rooms connected with tunnels. Each room is occupied by some bugs, and their brains hide in some of the rooms. Scientist 阅读全文
posted @ 2012-07-31 14:36
crying_Dream
阅读(261)
评论(0)
推荐(0)
摘要:
Description 平行世界是动漫作品中经常涉及的题材,而且往往这些作品都相当的精彩,如《寒蝉鸣泣之时》、《CLANNAD》、《魔法少女小圆》、《命运石之门》等。世界从诞生到结束,最终又轮回到诞生。无论命运如何的绝对,在无数次的轮回中终将被打破,犹如掷骰子,在无限接近于零但不等于零的机率中往复。这样在无限的反复和轮回中,将其可能性放大到100%。最典型的人物就是《海猫鸣泣之时》中的能无限次引发奇迹力量的“奇迹之魔女”贝伦卡斯泰露。而与此对应的是能够让事件发生的可能性无限接近于零“绝对的魔女”拉姆达戴露塔。在故事中,贝伦的目的是为了令主角战人在黄金魔女的游戏中“赢”,而拉姆达的目的则是为了让 阅读全文
posted @ 2012-07-31 14:26
crying_Dream
阅读(267)
评论(0)
推荐(0)
摘要:
Description在Mars星球上,每个Mars人都随身佩带着一串能量项链。在项链上有N颗能量珠。能量珠是一颗有头标记与尾标记的珠子,这些标记对应着某个正整数。并且,对于相邻的两颗珠子,前一颗珠子的尾标记一定等于后一颗珠子的头标记。因为只有这样,通过吸盘(吸盘是Mars人吸收能量的一种器官)的作用,这两颗珠子才能聚合成一颗珠子,同时释放出可以被吸盘吸收的能量。如果前一颗能量珠的头标记为m,尾标记为r,后一颗能量珠的头标记为r,尾标记为n,则聚合后释放的能量为m*r*n(Mars单位),新产生的珠子的头标记为m,尾标记为n。需要时,Mars人就用吸盘夹住相邻的两颗珠子,通过聚合得到能量,直到 阅读全文
posted @ 2012-07-31 14:21
crying_Dream
阅读(236)
评论(0)
推荐(0)
摘要:
Description金明今天很开心,家里购置的新房就要领钥匙了,新房里有一间金明自己专用的很宽敞的房间。更让他高兴的是,妈妈昨天对他说:“你的房间需要购买哪些物品,怎么布置,你说了算,只要不超过N元钱就行”。今天一早,金明就开始做预算了,他把想买的物品分为两类:主件与附件,附件是从属于某个主件的,下表就是一些主件与附件的例子:主件附件电脑打印机,扫描仪书柜图书书桌台灯,文具工作椅无如果要买归类为附件的物品,必须先买该附件所属的主件。每个主件可以有0个、1个或2个附件。附件不再有从属于自己的附件。金明想买的东西很多,肯定会超过妈妈限定的N元。于是,他把每件物品规定了一个重要度,分为5等:用整数 阅读全文
posted @ 2012-07-31 14:15
crying_Dream
阅读(234)
评论(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-07-31 13:51
crying_Dream
阅读(215)
评论(0)
推荐(0)
摘要:
DescriptionJohn Doe, a skilled pilot, enjoys traveling. While on vacation, he rents a small plane and starts visiting beautiful places. To save money, John must determine the shortest closed tour that connects his destinations. Each destination is represented by a point in the plane pi = < xi,yi 阅读全文
posted @ 2012-07-31 13:46
crying_Dream
阅读(178)
评论(0)
推荐(0)
摘要:
DescriptionYou want to arrange the window of your flower shop in a most pleasant way. You have F bunches of flowers, each being of a different kind, and at least as many vases ordered in a row. The vases are glued onto the shelf and are numbered consecutively 1 through V, where V is the number of va 阅读全文
posted @ 2012-07-31 13:43
crying_Dream
阅读(320)
评论(0)
推荐(0)
摘要:
DescriptionN gangsters are going to a restaurant. The i-th gangster comes at the time Ti and has the prosperity Pi. The door of the restaurant has K+1 states of openness expressed by the integers in the range [0, K]. The state of openness can change by one in one unit of time; i.e. it either opens b 阅读全文
posted @ 2012-07-31 13:40
crying_Dream
阅读(195)
评论(0)
推荐(0)
摘要:
DescriptionThere is a straight highway with villages alongside the highway. The highway is represented as an integer axis, and the position of each village is identified with a single integer coordinate. There are no two villages in the same position. The distance between two positions is the absolu 阅读全文
posted @ 2012-07-31 13:36
crying_Dream
阅读(467)
评论(0)
推荐(0)
浙公网安备 33010602011771号