摘要:
DescriptionCalculate the number of toys that land in each bin of a partitioned toy box. Mom and dad have a problem - their child John never puts his toys away when he is finished playing with them. They gave John a rectangular box to put his toys in, but John is rebellious and obeys his parents by s 阅读全文
posted @ 2012-03-14 23:15
'wind
阅读(183)
评论(0)
推荐(0)
摘要:
Problem DescriptionMany geometry(几何)problems were designed in the ACM/ICPC. And now, I also prepare a geometry problem for this final exam. According to the experience of many ACMers, geometry problems are always much trouble, but this problem is very easy, after all we are now attending an exam, no 阅读全文
posted @ 2012-03-14 23:14
'wind
阅读(254)
评论(0)
推荐(0)
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2012-03-14 23:13
'wind
阅读(18)
评论(0)
推荐(0)
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2012-03-14 23:12
'wind
阅读(10)
评论(0)
推荐(0)
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2012-03-14 23:10
'wind
阅读(6)
评论(0)
推荐(0)
摘要:
Problem DescriptionIn computer vision, a chain code is a sequence of numbers representing directions when following the contour of an object. For example, the following figure shows the contour represented by the chain code 22234446466001207560 (starting at the upper-left corner).Two chain codes may 阅读全文
posted @ 2012-03-14 18:27
'wind
阅读(319)
评论(0)
推荐(0)
摘要:
Problem DescriptionIgnatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀).Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统计的单词,一个空行代表单词表的结束.第二部分是一连串的提问,每行一个提问,每个提问都是一个字符串.注意:本题只有一组测试数据,处理到文件结束.Output对于每个提问,给出以该字符串为前缀的单词的数量Sample Inputbananabandbeeabsoluteacmba 阅读全文
posted @ 2012-03-14 18:26
'wind
阅读(233)
评论(0)
推荐(0)
摘要:
DescriptionA prefix of a string is a substring starting at the beginning of the given string. The prefixes of "carbon" are: "c", "ca", "car", "carb", "carbo", and "carbon". Note that the empty string is not considered a prefix in 阅读全文
posted @ 2012-03-14 18:24
'wind
阅读(259)
评论(0)
推荐(0)
摘要:
Problem DescriptionThe French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo group. A quote from the book:Tout avait Pair normal, mais tout s’affirmait faux. Tout avait Fair normal, d’abord, puis surgissait l’inhumain 阅读全文
posted @ 2012-03-14 18:23
'wind
阅读(189)
评论(0)
推荐(0)
摘要:
Problem Description一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢?Input输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字符有多少个,布条的花纹也有多少种花样。花纹条和小饰条不会超过1000个字符长。如果遇见#字符,则不再进行工作。Output输出能从花纹布中剪出的最多小饰条个数,如果一块都没有,那就老老实实输出0,每个结果之间应换行。Sample Inputabcde a3aaaaaa aa#Sample Output 阅读全文
posted @ 2012-03-14 18:22
'wind
阅读(132)
评论(0)
推荐(0)
摘要:
Problem DescriptionGiven two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...... , b[M] (1 <= M <= 10000, 1 <= N <= 1000000). Your task is to find a number K which make a[K] = b[1], a[K + 1] = b[2], ...... , a[K + M - 1] = b[M]. If there are more than one K exist, ou 阅读全文
posted @ 2012-03-14 18:22
'wind
阅读(176)
评论(0)
推荐(0)
摘要:
Problem Description给定一个长度为偶数位的0,1字符串,请编程实现串的奇偶位互换。Input输入包含多组测试数据;输入的第一行是一个整数C,表示有C测试数据;接下来是C组测试数据,每组数据输入均为0,1字符串,保证串长为偶数位(串长<=50)。Output请为每组测试数据输出奇偶位互换后的结果;每组输出占一行。Sample Input201101100Sample Output10011100code:View Code #include<stdio.h>int main(){ int i,t; char s[51]; scanf("%d" 阅读全文
posted @ 2012-03-14 18:20
'wind
阅读(262)
评论(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-03-14 18:10
'wind
阅读(347)
评论(0)
推荐(0)
摘要:
Problem Description给你一个n*n的格子的棋盘,每个格子里面有一个非负数。从中取出若干个数,使得任意的两个数所在的格子没有公共边,就是说所取的数所在的2个格子不能相邻,并且取出的数的和最大。Input包括多个测试实例,每个测试实例包括一个整数n 和n*n个非负数(n<=20)Output对于每个测试实例,输出可能取得的最大的和Sample Input375 15 2175 15 2834 70 5 Sample Output188分析:主要思想是从第一行到第N行,从第一列到第N列进行DP,用位来保存状态,比如在i行j列,对所有的0到2^n -1 状态进行计算,最后的结果 阅读全文
posted @ 2012-03-14 18:09
'wind
阅读(675)
评论(0)
推荐(0)
摘要:
Description在河上有一座独木桥,一只青蛙想沿着独木桥从河的一侧跳到另一侧。在桥上有一些石子,青蛙很讨厌踩在这些石子上。由于桥的长度和青蛙一次跳过的距离都是正整数,我们可以把独木桥上青蛙可能到达的点看成数轴上的一串整点:0,1,……,L(其中L是桥的长度)。坐标为0的点表示桥的起点,坐标为L的点表示桥的终点。青蛙从桥的起点开始,不停的向终点方向跳跃。一次跳跃的距离是S到T之间的任意正整数(包括S,T)。当青蛙跳到或跳过坐标为L的点时,就算青蛙已经跳出了独木桥。题目给出独木桥的长度L,青蛙跳跃的距离范围S,T,桥上石子的位置。你的任务是确定青蛙要想过河,最少需要踩到的石子数。Input有 阅读全文
posted @ 2012-03-14 18:08
'wind
阅读(1058)
评论(0)
推荐(0)
摘要:
Description在河上有一座独木桥,一只青蛙想沿着独木桥从河的一侧跳到另一侧。在桥上有一些石子,青蛙很讨厌踩在这些石子上。由于桥的长度和青蛙一次跳过的距离都是正整数,我们可以把独木桥上青蛙可能到达的点看成数轴上的一串整点:0,1,……,L(其中L是桥的长度)。坐标为0的点表示桥的起点,坐标为L的点表示桥的终点。青蛙从桥的起点开始,不停的向终点方向跳跃。一次跳跃的距离是s到t之间的任意正整数(包括s,t)。当青蛙跳到或跳过坐标为L的点时,就算青蛙已经跳出了独木桥。题目给出独木桥的长度L,青蛙跳跃的距离范围s,t,桥上石子的位置。你的任务是确定青蛙要想过河,最少需要踩到的石子数。Input有 阅读全文
posted @ 2012-03-14 18:07
'wind
阅读(345)
评论(0)
推荐(0)
摘要:
Problem Description给你一个m×n的整数矩阵,在上面找一个x×y的子矩阵,使子矩阵中所有元素的和最大。Input输入数据的第一行为一个正整数T,表示有T组测试数据。每一组测试数据的第一行为四个正整数m,n,x,y(0<m,n<1000 AND 0<x<=m AND 0<y<=n),表示给定的矩形有m行n列。接下来这个矩阵,有m行,每行有n个不大于1000的正整数。Output对于每组数据,输出一个整数,表示子矩阵的最大和。Sample Input14 5 2 23 361 649 676 588992 762 156 9 阅读全文
posted @ 2012-03-14 18:06
'wind
阅读(503)
评论(0)
推荐(0)
摘要:
Problem DescriptionGiven a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1 x 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 阅读全文
posted @ 2012-03-14 18:04
'wind
阅读(338)
评论(0)
推荐(0)
摘要:
Problem DescriptionBean-eating is an interesting game, everyone owns an M*N matrix, which is filled with different qualities beans. Meantime, there is only one bean in any 1*1 grid. Now you want to eat the beans and collect the qualities, but everyone must obey by the following rules: if you eat the 阅读全文
posted @ 2012-03-14 18:03
'wind
阅读(318)
评论(0)
推荐(0)
摘要:
Problem DescriptionA number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, ... shows the first 20 humble numbers.Write a program to find and print the nth element in this sequenceInputThe input co 阅读全文
posted @ 2012-03-14 18:02
'wind
阅读(261)
评论(0)
推荐(0)
摘要:
Problem DescriptionPirates have finished developing the typing software. He called Cathy to test his typing software. She is good at thinking. After testing for several days, she finds that if she types a string by some ways, she will type the key at least. But she has a bad habit that if the caps l 阅读全文
posted @ 2012-03-14 18:01
'wind
阅读(551)
评论(0)
推荐(1)
摘要:
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-03-14 17:56
'wind
阅读(286)
评论(0)
推荐(0)
摘要:
Problem Description都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能站人,所以他只能在小径上接。由于gameboy平时老呆在房间里玩游戏,虽然在游戏中是个身手敏捷的高手,但在现实中运动神经特别迟钝,每秒种只有在移动不超过一米的范围内接住坠落的馅饼。现在给这条小径如图标上坐标:为了使问题简化,假设在接下来的一段时间里,馅饼都掉落在0-10这11个位置。开始时 阅读全文
posted @ 2012-03-14 17:56
'wind
阅读(209)
评论(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-03-14 17:54
'wind
阅读(321)
评论(0)
推荐(0)
摘要:
Problem DescriptionXiao Ming and Xiao Bao are playing a simple Numbers game. In a round Xiao Ming can choose to write down a number, or ask Xiao Bao what the kth great number is. Because the number written by Xiao Ming is too much, Xiao Bao is feeling giddy. Now, try to help Xiao Bao.InputThere are 阅读全文
posted @ 2012-03-14 17:53
'wind
阅读(440)
评论(0)
推荐(0)
摘要:
Problem DescriptionA bee larva living in a hexagonal cell of a large honeycomb decides to creep for a walk. In each “step” the larva may move into any of the six adjacent cells and after n steps, it is to end up in its original cell.Your program has to compute, for a given n, the number of different 阅读全文
posted @ 2012-03-14 17:52
'wind
阅读(814)
评论(0)
推荐(0)
摘要:
Problem Description穿过幽谷意味着离大魔王lemon已经无限接近了!可谁能想到,yifenfei在斩杀了一些虾兵蟹将后,却再次面临命运大迷宫的考验,这是魔王lemon设下的又一个机关。要知道,不论何人,若在迷宫中被困1小时以上,则必死无疑!可怜的yifenfei为了去救MM,义无返顾地跳进了迷宫。让我们一起帮帮执着的他吧!命运大迷宫可以看成是一个两维的方格阵列,如下图所示:yifenfei一开始在左上角,目的当然是到达右下角的大魔王所在地。迷宫的每一个格子都受到幸运女神眷恋或者痛苦魔王的诅咒,所以每个格子都对应一个值,走到那里便自动得到了对应的值。现在规定yifenfei只能 阅读全文
posted @ 2012-03-14 17:51
'wind
阅读(207)
评论(0)
推荐(0)
摘要:
Problem Description搬寝室是很累的,xhd深有体会.时间追述2006年7月9号,那天xhd迫于无奈要从27号楼搬到3号楼,因为10号要封楼了.看着寝室里的n件物品,xhd开始发呆,因为n是一个小于2000的整数,实在是太多了,于是xhd决定随便搬2*k件过去就行了.但还是会很累,因为2*k也不小是一个不大于n的整数.幸运的是xhd根据多年的搬东西的经验发现每搬一次的疲劳度是和左右手的物品的重量差的平方成正比(这里补充一句,xhd每次搬两件东西,左手一件右手一件).例如xhd左手拿重量为3的物品,右手拿重量为6的物品,则他搬完这次的疲劳度为(6-3)^2 = 9.现在可怜的xh 阅读全文
posted @ 2012-03-14 17:49
'wind
阅读(289)
评论(0)
推荐(0)
摘要:
Description前段时间,某省发生干旱,B山区的居民缺乏生活用水,现在需要从A城市修一条通往B山区的路。假设有A城市通往B山区的路由m条连续的路段组成,现在将这m条路段承包给n个工程队(n≤m≤ 300)。为了修路的便利,每个工程队只能分配到连续的若干条路段(当然也可能只分配到一条路段或未分配到路段)。假设每个工程队修路的效率一样,即每修长度为1的路段所需的时间为1。现在给出路段的数量m,工程队的数量n,以及m条路段的长度(这m条路段的长度是按照从A城市往B山区的方向依次给出,每条路段的长度均小于1000),需要你计算出修完整条路所需的最短的时间(即耗时最长的工程队所用的时间)。Inpu 阅读全文
posted @ 2012-03-14 17:48
'wind
阅读(445)
评论(0)
推荐(0)
摘要:
DescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子1 2 3 4 516 17 18 19 615 24 25 20 714 23 22 21 813 12 11 10 9一个人可以从某个点滑向上下左右相邻四个点之一,当且仅当高度减小。在上面的例子中,一条可滑行的滑坡为24-17-16-1。当然25-24-23-...-3-2-1更长。事实上,这是最长的一条。 阅读全文
posted @ 2012-03-14 17:46
'wind
阅读(207)
评论(0)
推荐(0)
摘要:
DescriptionAn array of sizen≤ 106is given to you. There is a sliding window of sizekwhich is moving from the very left of the array to the very right. You can only see theknumbers in the window. Each time the sliding window moves rightwards by one position. Following is an example:The array is [13-1 阅读全文
posted @ 2012-03-14 17:43
'wind
阅读(209)
评论(0)
推荐(0)
摘要:
DescriptionSome of Farmer John'sNcows (1 ≤N≤ 80,000) are having a bad hair day! Since each cow is self-conscious about her messy hairstyle, FJ wants to count the number of other cows that can see the top of other cows' heads.Each cowihas a specified heighthi(1 ≤hi≤ 1,000,000,000) and is stan 阅读全文
posted @ 2012-03-14 17:42
'wind
阅读(589)
评论(0)
推荐(0)
摘要:
Problem DescriptionNowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you now.The game can be played by two or more than two players. It consists of a chessboard(棋盘)and some 阅读全文
posted @ 2012-03-14 17:40
'wind
阅读(337)
评论(0)
推荐(0)
摘要:
Problem DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = <x1, x2, ..., xm> another sequence Z = <z1, z2, ..., zk> is a subsequence of X if there exists a strictly increasing sequence <i1, i2, ..., ik&g 阅读全文
posted @ 2012-03-14 17:39
'wind
阅读(937)
评论(0)
推荐(0)
摘要:
DescriptionGiven a set of n integers: A={a1, a2,..., an}, we define a function d(A) as below:Your task is to calculate d(A).InputThe input consists of T(<=30) test cases. The number of test cases (T) is given in the first line of the input.Each test case contains two lines. The first line is an i 阅读全文
posted @ 2012-03-14 17:34
'wind
阅读(1106)
评论(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-03-14 17:32
'wind
阅读(762)
评论(0)
推荐(0)
摘要:
Description"47 is the quintessential random number," states the 47 society. And there might be a grain of truth in that.For example, the first ten digits of the Euler's constant are:2 7 1 8 2 8 1 8 2 8And what's their sum? Of course, it is 47.You are given a sequence S of integers 阅读全文
posted @ 2012-03-14 17:22
'wind
阅读(445)
评论(0)
推荐(0)
摘要:
Problem Description世界杯结束了,意大利人连本带利的收回了法国人6年前欠他们的债,捧起了大力神杯,成就了4星意大利.世界杯虽然结束了,但是这界世界杯给我们还是留下许多值得回忆的东西.比如我们听到了黄名嘴的3分钟激情解说,我们懂得了原来可以向同一个人出示3张黄牌,我们还看到了齐达内的头不仅能顶球还能顶人…………介于有这么多的精彩,xhd决定重温德国世界杯,当然只是去各个承办世界杯比赛的城市走走看看.但是这需要一大比钱,幸运的是xhd对世界杯的热爱之情打动了德国世界杯组委会,他们将提供xhd在中国杭州和德国任意世界杯承办城市的往返机票,并说服了这些城市在xhd到达这座城市时为他提 阅读全文
posted @ 2012-03-14 17:20
'wind
阅读(250)
评论(0)
推荐(0)
摘要:
Description一年一度的哈理工选美大赛开始了.来自各个院系的N个美女们都在一起排成一排,然后从左到右给他们标号(1-N),评委叫兽开始观摩,由于身高高低都不同, 叫兽想从中选出尽可能多的人使得他们的身高从左到右依次递增,你能帮助叫兽吗?Input输入数据第一行一个数据表示美女的个数N(0接下来有N个数据表示1-N标号的美女的身高,身高范围都在0-180之内当N=0时候输入结束Output按照样例输出,首先The number is N:N是选出最多美女个数,然后后面输出N个数,代表选出美女的标号,从左到右依次输出.题目保证答案唯一Sample Input32 1 231 2 30Sam 阅读全文
posted @ 2012-03-14 14:55
'wind
阅读(301)
评论(0)
推荐(0)
摘要:
Problem Description某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的高度.某天,雷达捕捉到敌国的导弹来袭.由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有的导弹.怎么办呢?多搞几套系统呗!你说说倒蛮容易,成本呢?成本是个大问题啊.所以俺就到这里来求救了,请帮助计算一下最少需要多少套拦截系统.Input输入若干组数据.每组数据包括:导弹总个数(正整数),导弹依此飞来的高度(雷达给出的高度数据是不大于30000的正整数,用空格分隔)Output对应每组数据 阅读全文
posted @ 2012-03-14 14:53
'wind
阅读(239)
评论(0)
推荐(0)
摘要:
转自:// Blog:www.WuTianQi.com最长上升子序列 LIS(Longest Increasing Subsequence)引出:问题描述:给出一个序列a1,a2,a3,a4,a5,a6,a7….an,求它的一个子序列(设为s1,s2,…sn),使得这个子序列满足这样的性质,s1<s2<s3<…<sn并且这个子序列的长度最长。输出这个最长的长度。(为了简化该类问题,我们将诸如最长下降子序列及最长不上升子序列等问题都看成同一个问题,其实仔细思考就会发现,这其实只是<符号定义上的问题,并不影响问题的实质)例如有一个序列:1 7 3 5 9 4 8,它的 阅读全文
posted @ 2012-03-14 14:49
'wind
阅读(953)
评论(0)
推荐(1)
摘要:
Problem Description电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大家都希望尽量使卡上的余额最少。某天,食堂中有n种菜出售,每种菜可购买一次。已知每种菜的价格以及卡上的余额,问最少可使卡上的余额为多少。Input多组数据。对于每组数据:第一行为正整数n,表示菜的数量。n<=1000。第二行包括n个正整数,表示每种菜的价格。价格不超过50。第三行包括一个正整数m,表示卡上的余额。m<=1000。n=0表示数据结束。Ou 阅读全文
posted @ 2012-03-14 14:16
'wind
阅读(264)
评论(0)
推荐(0)
摘要:
Problem DescriptionNowadays, we all know that Computer College is the biggest department in HDU. But, maybe you don't know that Computer College had ever been split into Computer College and Software College in 2002.The splitting is absolutely a big event in HDU! At the same time, it is a troubl 阅读全文
posted @ 2012-03-14 14:14
'wind
阅读(333)
评论(0)
推荐(0)
摘要:
Problem DescriptionSpeakless很早就想出国,现在他已经考完了所有需要的考试,准备了所有要准备的材料,于是,便需要去申请学校了。要申请国外的任何大学,你都要交纳一定的申请费用,这可是很惊人的。Speakless没有多少钱,总共只攒了n万美元。他将在m个学校中选择若干的(当然要在他的经济承受范围内)。每个学校都有不同的申请费用a(万美元),并且Speakless估计了他得到这个学校offer的可能性b。不同学校之间是否得到offer不会互相影响。“I NEED A OFFER”,他大叫一声。帮帮这个可怜的人吧,帮助他计算一下,他可以收到至少一份offer的最大概率。(如果 阅读全文
posted @ 2012-03-14 14:12
'wind
阅读(253)
评论(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-03-14 14:09
'wind
阅读(1172)
评论(0)
推荐(0)
摘要:
Problem DescriptionWhuacmers use coins.They have coins of value A1,A2,A3...An Silverland dollar. One day Hibix opened purse and found there were some coins. He decided to buy a very nice watch in a nearby shop. He wanted to pay the exact price(without change) and he known the price would not more th 阅读全文
posted @ 2012-03-14 14:06
'wind
阅读(456)
评论(0)
推荐(0)
摘要:
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 unfortunately, some 阅读全文
posted @ 2012-03-14 14:02
'wind
阅读(235)
评论(0)
推荐(0)
摘要:
Problem Description为了挽救灾区同胞的生命,心系灾区同胞的你准备自己采购一些粮食支援灾区,现在假设你一共有资金n元,而市场有m种大米,每种大米都是袋装产品,其价格不等,并且只能整袋购买。请问:你用有限的资金最多能采购多少公斤粮食呢?Input输入数据首先包含一个正整数C,表示有C组测试用例,每组测试用例的第一行是两个整数n和m(1<=n<=100, 1<=m<=100),分别表示经费的金额和大米的种类,然后是m行数据,每行包含3个数p,h和c(1<=p<=20,1<=h<=200,1<=c<=20),分别表示每袋的价 阅读全文
posted @ 2012-03-14 14:00
'wind
阅读(303)
评论(0)
推荐(0)
摘要:
DescriptionDota中英雄技能攻击会有一个范围,现在释放一个技能给出他的攻击范围和目标英雄的位置,问是否能攻击到。攻击范围保证是一个多边型。Input有多组测试数据第一行输入1个整数n,期中n代表攻击范围是给出的n个点组成的多边形,按照时针方向(顺或逆)依次给出,(n>=3)N = 0输入结束。第二行a,b表示目标英雄的坐标( 0 < a,b<100)接下来有n行,每行两个整数x,y(0 < x,y <100)表示每个点的坐标攻击范围在边缘也算在内Output每组结果输出占一行如果能够攻击到输出”Yes”否则输出”No”Sample Input31 14 阅读全文
posted @ 2012-03-14 13:05
'wind
阅读(187)
评论(0)
推荐(0)
摘要:
Descriptiondccmx likes playing Warcraft III. Now, he is teaching his girlfriend to play it. In Warcraft III, there are many kinds of units. Every unit costs some gold and lumber. Different units have different attack value.Now question comes. Given some amount of gold and a list of types of units, h 阅读全文
posted @ 2012-03-14 07:37
'wind
阅读(286)
评论(0)
推荐(0)
摘要:
Problem DescriptionThe bone collector had a big bag with a volume of V ,and along his trip of collecting there are a lot of bones , obviously , different bone has different value and different volume, now given the each bone’s value along his trip , can you calculate out the maximum of the total val 阅读全文
posted @ 2012-03-14 07:30
'wind
阅读(388)
评论(0)
推荐(0)


浙公网安备 33010602011771号