发新话题
打印

中南民族大学首届程序设计大赛选编

中南民族大学首届程序设计大赛选编

因为试题难度的原因,绝大部分参赛的选手都是计算机学院的同学,不服的来试试看(内部资料)

Problem A         Floors

The new highway promised a better and faster connection between A and B and a considerable reduction of congestion.Unfortunately there was an obstacle:the old
mansion.This conflict was soon resolved in favour of the highway.

Shortly before the demolition of the mansion was baout to start, a lover of old mansions found out that the colorfully tiled floors in the mansion were designed by the
famous painter Mondriaan, and therefore had great cultural value. They should be saved.They should be removed from the mansion before the mansion will be demolished.

A floor moving expert was hired to accomplish the job.He decided to cut each floor into smaller pieces, in order to make it more tractable. He possessed a fine floor cutting tool which enabled him to cut a rectangular piece of floor into weo smaller rectangular pieces,cutting parallel to one of the sides.Of course the cutting should be between
tiles; cutting through a tile was not an option. This way the floor in Figure 1 conld easily be cut into 9 tiles. The floor in Figure 2 however can not be cut into smaller pieces.The floor in Figure 3 can be cut into six pieces, but one of the parts will consist of several titles.
本帖最近评分记录
  • ykjennifer12 经验 +10 精品文章 实用好贴加分鼓励 再接再 ... 2007-1-22 15:50
懂得感恩,认真对待身边的每一个人
不要觉得父母对你的好是应该的,积极去回报他们
无论何时何地,说对不起的时候请直视对方
拿起电话的时候要保持微笑,因为对方能感觉的到

TOP

While preparing for the job,  the floor moving expert was anxious to know how large the remaining pieces could be: would they be heavy ,very heavy or extremely heavy?What kind of floor lifting tool should be hired? Because the floors have a fixed thickness, and a fixed density, the weight of a piece of floor only depend on its area.

Given a rectangular floor covered with rectangular tiles, find the area of the largest piece, after the floor is cut into the smallest possible pieces. The words smallest and
largest refer to the area of the pieces. Cutting through a title is not allowed .A cut through  a rectangle is always parallel to one of the sides, and through the full length (or width) of the rectangle.



Input

The input contains several floors.The first line of the input gives the number of floors.

Each floor is described in several lines.The first line contains two positive integers:the length and width of the floor,in millimeters. A floor is at most 40000mm long or wide.
The next line contains a single number: the number t of tiles(1<=t<=100).The following t lines each contain the description of a tile. A tile is given as four integers:

Xl Yl Xh Yh

where (xl,yl) are the coordinates of the lower left corner of the tile, and (xh,yh) are the coordinates of the upper rightmost corner of the tile.A tile always has a positive
area. The order of the coordinates of the floor and those of the tile coincide of course.

You may assume that the tiles are mutually disjoint, and cover the floor, the whole floor, and nothing but the floor.

Output

For each test case (each floor) the output contains a number, on a single line:the area of the largest piece of floor (in square millimeters), after cutting the floor into the
smallest pieces possible, with the given restrictions.
懂得感恩,认真对待身边的每一个人
不要觉得父母对你的好是应该的,积极去回报他们
无论何时何地,说对不起的时候请直视对方
拿起电话的时候要保持微笑,因为对方能感觉的到

TOP

Sample Input


2
300  400
3
0 0 300 200
0 200 200 400
200 200 300 400
300 300
5
0 0 200 100
200 0 300 200
100 200 300 300
100 100 200 200


Sample Output

60000
90000
懂得感恩,认真对待身边的每一个人
不要觉得父母对你的好是应该的,积极去回报他们
无论何时何地,说对不起的时候请直视对方
拿起电话的时候要保持微笑,因为对方能感觉的到

TOP

请用JAVA C C++其中的一种编写

[ 本帖最后由 BoTord 于 2007-1-25 11:45 编辑 ]
懂得感恩,认真对待身边的每一个人
不要觉得父母对你的好是应该的,积极去回报他们
无论何时何地,说对不起的时候请直视对方
拿起电话的时候要保持微笑,因为对方能感觉的到

TOP

隔行如隔山,小B同学太执著于一点了。
寸有所长,尺有所短。
如果让你参加个什么书法绘画大赛,你也会无语的。
不过,还是支持小B把这些拿出来交流。
小B,fighting!

TOP

第一个回帖的……
竟然是我家小N
交流归交流,我没有拿出来为难大家的意思
因为计算机的人也不一定看得懂

试着做下而已

PS:喵的,你头像怎么是这样的?
懂得感恩,认真对待身边的每一个人
不要觉得父母对你的好是应该的,积极去回报他们
无论何时何地,说对不起的时候请直视对方
拿起电话的时候要保持微笑,因为对方能感觉的到

TOP

这才对么……
:)
懂得感恩,认真对待身边的每一个人
不要觉得父母对你的好是应该的,积极去回报他们
无论何时何地,说对不起的时候请直视对方
拿起电话的时候要保持微笑,因为对方能感觉的到

TOP

愣是看都没看懂
关注http://xydx.blogbus.com,持续更新中
迎新期间,手机24小时开机。13437159893 新生问题请电话,尽量不要短信。

TOP

辛苦楼主
需要的同学过来看看 交流交流
实用好贴加分鼓励!!

TOP

Problem  B   The Picnic

The annual picnic of the Zeron company will take place tomorrow.This year they have agreed on the Gloomwood park as the place to be. The girl responsible for the arrangementm, Lilith, thinks it would be nice if everyone is able to watch everyone else during the occasion.From geometry class she remembers that a region in the plane with
the property that a straight line between any two points in the region, lies entirely in the region, is called convex. So that is what she is looking for. Unfortunately, this seems hard to fulfil, since Gloomwood has many opaque obstacles, such as large trees, rocks, and so on.
Owing to the fact that the staff of the Zeron company is pretty large,Lilith has a rather intricate problem to solve: finding a location to hold them all. Therefore, some of her friends help her to draw a map of the whereabouts of the largest obstacles on the circumference of the chosen region. The opaque ovstacles should be thought of as
points of zero extension.


The Gloomwood park from above with black dots representing obstacles.The picnic area is the region whose circumference is dashed.


Input

The first line of the input contains a single posetive integer n, specifying the number of test scenarios to follow. Each test scenario begins with a line containing an integer m, the number of obstacles in the park (2<m<100).The next line contains the coordinates of the m obstacles, in the order x1 y1 x2 y2 x3 y3...All coordinates are integers
in the range [0,1000]. Each scenario has at least three ovstacles that are not on a straight line, and no two obstacles have the same coordinates.

Output

For each test scenario, one line of output should be generated, stating the area with one decimal of the largest convex polygon having ovstacles as corners, but no
enclosed ovstacles.


Sample Input

1
11
3 3 8 4 12 2 22 3 23 5 24 7 27 12 18 12 13 13 6 10 9 6

Sample Output

129.0
懂得感恩,认真对待身边的每一个人
不要觉得父母对你的好是应该的,积极去回报他们
无论何时何地,说对不起的时候请直视对方
拿起电话的时候要保持微笑,因为对方能感觉的到

TOP

虽然这里的人气很低
但是我会一如既往的支持下去
fighting
(今天考得不错,心情很好)
懂得感恩,认真对待身边的每一个人
不要觉得父母对你的好是应该的,积极去回报他们
无论何时何地,说对不起的时候请直视对方
拿起电话的时候要保持微笑,因为对方能感觉的到

TOP

fighting:shake
(我今天考得也不错,心情也很好)

TOP

那就请客吃饭吧
懂得感恩,认真对待身边的每一个人
不要觉得父母对你的好是应该的,积极去回报他们
无论何时何地,说对不起的时候请直视对方
拿起电话的时候要保持微笑,因为对方能感觉的到

TOP

发新话题