CF442E.Gena and Second Distance

NOI/NOI+/CTSC

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

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

题目描述

Gena doesn't like geometry, so he asks you to solve this problem for him.

A rectangle with sides parallel to coordinate axes contains n dots. Let's consider some point of the plane. Let's count the distances from this point to the given n points. Let's sort these numbers in the non-decreasing order. We'll call the beauty of the point the second element of this array. If there are two mimimum elements in this array, the beaty will be equal to this minimum.

Find the maximum beauty of a point inside the given rectangle.

吉娜不喜欢几何,因此她请你帮她解决这个问题。

一个边与坐标轴平行的矩形内包含 nn 个点。考虑平面上的某个点,计算该点到给定的 nn 个点的距离,并将这些距离按非递减顺序排序。我们称该点的“美观度”(beauty)为该数组中第二个元素的值;若该数组中存在两个最小元素(即最小值出现至少两次),则美观度即为该最小值。

求矩形内部所有点中最大的美观度。

输入格式

The first line contains three integers w, h, n (1 ≤ w, h ≤ 106, 2 ≤ n ≤ 1000) — the lengths of the rectangle sides and the number of points. Next n lines contain two integers x__i, y__i (0 ≤ x__i ≤ w, 0 ≤ y__i ≤ h) each — the coordinates of a point. It is possible that it will be coincident points.

第一行包含三个整数 ww、hh、nn(1≤w,h≤1061 \le w, h \le 10^6,2≤n≤10002 \le n \le 1000)——分别表示矩形的边长和点的数量。接下来的 nn 行每行包含两个整数 xix_i、yiy_i(0≤xi≤w0 \le x_i \le w,0≤yi≤h0 \le y_i \le h)——表示一个点的坐标。可能存在重合的点。

输出格式

Print a single number — the maximum beauty of a point with the absolute or relative error of at most 10 - 9.

输出一个数字——该点的最大美观度,绝对或相对误差不超过 10−910^{-9}。

输入输出样例

  • 输入#1

    5 5 4
    0 0
    5 0
    0 5
    5 5

    输出#1

    4.99999999941792339
  • 输入#2

    5 5 3
    4 0
    2 5
    4 1

    输出#2

    5.65685424744772014

说明/提示

The point which beauty we need to find must have coordinates (x, y), where 0 ≤ x ≤ w, 0 ≤ y ≤ h. Some of the n points can coincide.

我们需要寻找的具有美感的点的坐标为 (x, y)(x, y),其中 0 ≤ x ≤ w0 \le x \le w,0 ≤ y ≤ h0 \le y \le h。这 nn 个点中可能有重合的点。

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

首页