• 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.

  • 相关阅读:
    Intent的跳转和传值
    Intent传值的学习
    Activity,Window,View之间是什么关系?
    MATCH_PARENT和FILL_PARENT之间的区别?
    Activity的运行过程
    onCreate和onStart谁的开销大?
    SDKManager连不上墙外的网,列表刷新不出来怎么办?
    AndroidEclipse里的视图里想添加SDK Manager但是找不到怎么办?
    出现“Unable to resolve target 'android-XXX'”怎么处理?
    安卓进程的生命周期
  • 原文地址:https://www.cnblogs.com/wutongtong3117/p/7673251.html
Copyright © 2020-2023  润新知