CF274C.The Last Hole!

省选/NOI-

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Luyi has n circles on the plane. The i-th circle is centered at (x__i, y__i). At the time zero circles start to grow simultaneously. In other words, the radius of each circle at time t (t > 0) is equal to t. The circles are drawn as black discs on an infinite white plane. So at each moment the plane consists of several black and white regions. Note that the circles may overlap while growing.

We define a hole as a closed, connected white region. For instance, the figure contains two holes shown by red border. During growing some holes may be created and it is easy to see that each created hole will disappear eventually. Luyi asks you to find moment of time such that the last hole disappears. In other words, you should find the first moment such that no hole can be seen after that.

吕毅在平面上有 nn 个圆。第 ii 个圆的圆心位于 (xi, yi)(x_i,\,y_i)。在时刻零,所有圆同时开始扩张。换言之,每个圆在时刻 tt(t>0t > 0)的半径等于 tt。这些圆被绘制为无限大白色平面上的黑色圆盘。因此,在任意时刻,平面由若干黑色与白色区域组成。注意:在扩张过程中,圆之间可能发生重叠。

我们定义一个“洞”为一个闭合且连通的白色区域。例如,图中用红色边框标出了两个洞。在扩张过程中,某些洞会被生成;显然,每个生成的洞最终都会消失。吕毅请你找出最后一个洞消失的时刻。换句话说,你需要找出首个时刻,使得在此时刻之后再也看不到任何洞。

输入格式

The first line of the input contains integer n (1 ≤ n ≤ 100). Each of the next n lines contains two integers x__i and y__i ( - 104 ≤ x__i, y__i ≤ 104), indicating the location of i-th circle.

It's guaranteed that no two circles are centered at the same point.

输入的第一行包含一个整数 nn(1≤n≤1001 \leq n \leq 100)。接下来的 nn 行中,每行包含两个整数 xix_i 和 yiy_i(−104≤xi,yi≤104-10^4 \leq x_i, y_i \leq 10^4),表示第 ii 个圆的圆心坐标。

保证任意两个圆的圆心不重合。

输出格式

Print the moment where the last hole disappears. If there exists no moment in which we can find holes print -1.

The answer will be considered correct if the absolute or relative error does not exceed 10 - 4.

输出最后一个洞消失的时刻。如果不存在任何存在洞的时刻,则输出 −1-1。

若答案的绝对误差或相对误差不超过 10−410^{-4},则视为正确。

输入输出样例

  • 输入#1

    3
    0 0
    1 1
    2 2

    输出#1

    -1
  • 输入#2

    4
    0 0
    0 2
    2 2
    2 0

    输出#2

    1.414214
  • 输入#3

    4
    0 1
    0 -1
    -2 0
    4 0

    输出#3

    2.125000

输入解题思路,AI测评打分。不知道怎么写?

首页