摘要:Greatest Number时间限制(普通/Java):1000MS/3000MS 运行内存限制:65536KByte 描述Saya likes math, because she think math can make her cleverer.One day, Kudo invited a very simple game:Given N integers, then the players choose no more than four integers from them (can be repeated) and add them together. Finally, the o
阅读全文
摘要:图案变换问题时间限制(普通/Java):1000MS/3000MS 运行内存限制:65536KByte描述给出一个正方形图案和它的变换图案,称为图案变换对。编写程序,求图案变换对之间的最小变换。图案是由黑白两种小方块构成的。可能的变换包括: (1) 旋转 90 度:图案顺时针旋转 90 度,记做 rot90 (2) 旋转 180 度:图案顺时针旋转 180 度,记做 rot180 (3) 旋转 270 度:图案顺时针旋转 270 度,记做 rot270 (4) 竖直映像:图案以其上方的一条平行线为轴翻转,记做 vr (5) 联合变换:图案首先做一次竖直映像变换,然后做一次旋转变换,...
阅读全文
摘要:计算机辅助设计时间限制(普通/Java):1000MS/3000MS 运行内存限制:65536KByte 描述 在计算机辅助设计(CAD)中,有一个经典问题:消除隐藏线(被其它图形遮住的线段) 。你需要设计一个软件,帮助建筑师绘制城市的侧视轮廓图。为了方便处理,限定所有的建筑物都是矩形的,而且全部建立在同一水平面上。每个建筑物用一个三元组表示(Li, Hi, Ri)其中 Li 和 Ri 分别是建筑物 i 的左右边缘坐标,Hi 是建筑物 i 的高度。 下面左图中的建筑物分别用如下三元组表示: (1,11,5),(2,6,7),(3,13,9),(12,7,16),(14,3,25),(19,1.
阅读全文
摘要:Parade ShowTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65535/65535 K (Java/Others)描述2013 is the 60 anniversary of Nanjing University of Science and Technology, and today happens to be the anniversary date. On this happy festival, school authority hopes that the new students to be trained for
阅读全文
摘要:GAP时间限制(普通/Java):3000MS/10000MS 运行内存限制:65536KByte 描述最近经常下雨,泥泞的道路已经让人不爽,如果不小心踩到水沟(gap)里就相当刺激了。 某位热爱科学的无聊闷骚猥琐男想到了这样一个问题:水沟里有多少水? 为了简化问题,我们只需求出给定的一个纵切面上雨水所占的面积即可。 如图所示,假设在这个纵切面上,水沟的轮廓可以用一条抛物线描述: 水平面位于y=0。换言之,由y=0和两条曲线围成的区域就是雨水所在的区域。 输入输入包括多组数据。 每组数据仅占一行,包括三个浮点数a, b, c (a>0)。当输入的a小于0时则表示输入结束,你的程序应该到此
阅读全文
摘要:半数集问题时间限制(普通/Java):3000MS/10000MS 运行内存限制:65536KByte描述给定一个自然数n,由n开始可以依次产生半数集set(n)中的数如下。 (1) n∈set(n); (2) 在n的左边加上一个自然数,但该自然数不能超过最近添加的数的一半; (3) 按此规则进行处理,直到不能再添加自然数为止。 例如,set(6)={6,16,26,126,36,136}。半数集set(6)中有6 个元素。 注意半数集是多重集。 编程任务: 对于给定的自然数n,编程计算半数集set(n)中的元素个数。 输入输入数据只有1 行,给出整数n。(0#include#includeu
阅读全文
摘要:解救小Q时间限制(普通/Java):3000MS/10000MS 运行内存限制:65536KByte描述小Q被邪恶的大魔王困在了迷宫里,love8909决定去解救她。迷宫里面有一些陷阱,一旦走到陷阱里,就会被困身亡:(,迷宫里还有一些古老的传送阵,一旦走到传送阵上,会强制被传送到传送阵的另一头。现在请你帮助love8909算一算,他至少需要走多少步才能解救到小Q? (上下左右四个方向走,传送门可以多次使用)输入第一行为一个整数T,表示测试数据组数。每组测试数据第一行为两个整数N,M,(1 #include#include#includeusing namespace std;int dir[4
阅读全文
摘要:玩叠骰子时间限制(普通/Java):3000MS/10000MS 运行内存限制:65536KByte描述大家都玩过骰子吧,骰子一般都被用来赌博的工具,但是我们ACM的成员不一样。我们可以用骰子来编写出各种各样的题目,给广大爱好ACM的人锻炼思考问题的能力。看看骰子: 很熟悉吧o(∩_∩)o ~~~ 废话不多说我们看题:现在给你n个骰子,把他们规范的叠起来,叠好后会有一些骰子的面被遮住,现在问你怎么叠没被遮住的那些面的点数和最大? 说明:叠的时候不能错开的叠,也就是说两个面要满满的叠住。并且叠在地上的那面也算被遮住的。Do you know?上面这个叠法就不合法。 骰子:每个面点数分别是:1..
阅读全文
摘要:敌兵布阵时间限制(普通/Java):3000MS/10000MS 运行内存限制:65536KByte描述C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视。中央情报局要研究敌人究竟演习什么战术,所以Tidy要随时向Derek汇报某一段连续的工兵营地一共有多少人,例如Derek问:“Tidy,马上
阅读全文
摘要:Number Steps时间限制(普通/Java):3000MS/10000MS 运行内存限制:65536KByte 描述Starting from point (0,0) on a plane, we have written all non-negative integers 0, 1, 2,... as shown in the figure. For example, 1, 2, and 3 has been written at points (1,1), (2,0), and (3, 1) respectively and this pattern has continued. Y
阅读全文
摘要:String Statistics时间限制(普通/Java):1000MS/3000MS 运行内存限制:65536KByte描述You have an n × n matrix of lower-case letters. You start from somewhere in the matrix, walk in one of the eight directions (left, right, up, down, up-left, up-right, down-left, down-right) and concatenate every letter you meet, in
阅读全文
摘要:Naive and Silly MugglesTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Problem DescriptionThree wizards are doing a experiment. To avoid from bothering, a special magic is set around them. The magic forms a circle, which covers those three wizards, in other words, all
阅读全文
摘要:The area时间限制(普通/Java):3000MS/10000MS 运行内存限制:65536KByte 描述Ignatius bought a land last week, but he didn't know the area of the land because the land is enclosed by a parabola and a straight line. The picture below shows the area. Now given all the intersectant points shows in the picture, can you
阅读全文
摘要:线段长度问题时间限制(普通/Java):5000MS/10000MS 运行内存限制:65536KByte描述在数轴X轴上有n条线段,线段之间可以有重叠,计算所有线段覆盖X轴的总长度。 输入输入文件第一行为测试用例个数N(1#include#include#include#includeusing namespace std;typedef struct{ double x; double y;}P;bool func(P a,P b){ return (a.x>t; while(t--) { cin>>n; p = new P[n]; ...
阅读全文
摘要:Jumping Cows时间限制(普通/Java):3000MS/10000MS 运行内存限制:65536KByte描述Farmer John's cows would like to jump over the moon, just like the cows in their favorite nursery rhyme. Unfortunately, cows can not jump. The local witch doctor has mixed up P (1 #include#include#include#includeusing namespace std;int
阅读全文
摘要:Triangular Pastures时间限制(普通/Java):3000MS/10000MS 运行内存限制:65536KByte描述Like everyone, cows enjoy variety. Their current fancy is new shapes for pastures. The old rectangular shapes are out of favor; new geometries are the favorite.I. M. Hei, the lead cow pasture architect, is in charge of creating a tri
阅读全文
摘要:Human Gene Functions时间限制(普通/Java):3000MS/10000MS 运行内存限制:65536KByte描述It is well known that a human gene can be considered as a sequence, consisting of four nucleotides, which are simply denoted by four letters, A, C, G, and T. Biologists have been interested in identifying human genes and determining
阅读全文
摘要:Number Triangles时间限制(普通/Java):5000MS/10000MS 运行内存限制:65536KByte描述Consider the number triangle shown below. Write a program that calculates the highest sum of numbers that can be passed on a route that starts at the top and ends somewhere on the base. Each step can go either diagonally down to the lef
阅读全文