poj2451Uyuw's Concert(怎么也A不掉的题翻译)

译文:
题目描述
Remmarguts王子成功地解决了CHESS问题,作为奖励,Uyuw计划在一个以其伟大的设计师Ihsnayish命名的大型广场上举办一场音乐会。

广场是一个[0,10000]*[0,10000]的正方形。
广场上有些长木椅已经在那里站了好几年了,但是ta们的排列方式非常的杂乱,如图:

这里写图片描述

上图的情况中,我们有三张椅子,观众们面朝着箭头所指的方向。这些椅子又旧又重,无法移动。Remmarguts公主告诉piazza的现任老板UW先生,ta想在里面建一个大舞台。舞台必须尽可能的大,但也应该确保每个观众能够不转身地看到舞台。

为了让问题简单一点,舞台可以搭建的足够高,确保只要面对舞台,就能看到歌手(同时也是钢琴家) Uyuw。

输入
第一行输入一个正整数N (N <= 20000),表示椅子的数量。接下来的N行,每行包含四个浮点数x1, y1, x2, y2,用来描述一张椅子,表示该椅子位于直线 (x1, y1) – (x2, y2)上, 并且观众面向该直线的左侧(这意味着,对于任意符合要求的点 (x, y) 都有(x – x1) * (y – y2) – (x – x2) * (y – y1) >= 0).

输出
输出一个浮点数,保留一位小数。表示舞台的大小。

样例输入
3
10000 10000 0 5000
10000 5000 5000 10000
0 5000 5000 0

样例输出
54166666.7

说明
样例输入的情况如下图,蓝色部分是舞台:
这里写图片描述
建议pascal用户使用Extended,C / C++用户使用long double来避免精度带来的问题。然而标称用的是double。

原文:
Description
Prince Remmarguts solved the CHESS puzzle successfully. As an award, Uyuw planned to hold a concert in a huge piazza named after its great designer Ihsnayish.

The piazza in UDF - United Delta of Freedom’s downtown was a square of [0, 10000] * [0, 10000]. Some basket chairs had been standing there for years, but in a terrible mess. Look at the following graph.
这里写图片描述

In this case we have three chairs, and the audiences face the direction as what arrows have pointed out. The chairs were old-aged and too heavy to be moved. Princess Remmarguts told the piazza’s current owner Mr. UW, to build a large stage inside it. The stage must be as large as possible, but he should also make sure the audience in every position of every chair would be able to see the stage without turning aside (that means the stage is in the forward direction of their own).

To make it simple, the stage could be set highly enough to make sure even thousands of chairs were in front of you, as long as you were facing the stage, you would be able to see the singer / pianist – Uyuw.

Being a mad idolater, can you tell them the maximal size of the stage?

Input
In the first line, there’s a single non-negative integer N (N <= 20000), denoting the number of basket chairs. Each of the following lines contains four floating numbers x1, y1, x2, y2, which means there’s a basket chair on the line segment of (x1, y1) – (x2, y2), and facing to its LEFT (That a point (x, y) is at the LEFT side of this segment means that (x – x1) * (y – y2) – (x – x2) * (y – y1) >= 0).

Output
Output a single floating number, rounded to 1 digit after the decimal point. This is the maximal area of the stage.

Sample Input
3
10000 10000 0 5000
10000 5000 5000 10000
0 5000 5000 0

Sample Output
54166666.7

Hint
Sample input is the same as the graph above, while the correct solution for it is as below:
这里写图片描述
I suggest that you use Extended in pascal and long double in C / C++ to avoid precision error. But the standard program only uses double.

转载于:https://www.cnblogs.com/wutongtong3117/p/7673252.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值