QOJ.ac

QOJ

حد الوقت: 1 s حد الذاكرة: 256 MB مجموع النقاط: 100

#1433. 离群值

الإحصائيات

Zenyk 和 Marichka 在玩一个关于石头集合的游戏。在这个游戏中,Marichka 将一组石头排列在一个平面上。

她指定其中一块石头为秘密的“离群点”(outlier),但不告诉 Zenyk,并据此进行排列。该离群点具有以下特性:当你将其从排列中移除时,剩余石头的宽度最小;也就是说,如果你保留这块秘密石头而移除任何其他石头,石头集合的宽度都会更大。几何上,一组石头的宽度定义为包含所有石头(在两条平行线之间或之上)的两条平行线之间的最小距离。你能帮 Zenyk 找到这个秘密的离群点吗?

具体来说,在本题中,你将得到一个包含 $n$ 个不同二维点的集合 $S$,表示 Marichka 排列中石头的位置。你的目标是找到集合 $S$ 中的离群点,并报告移除该离群点后石头集合的宽度。

形式化地,给定一个二维点集 $S = \{p_i\}$,对于每个点 $p_i$ ($1 \le i \le n$),计算点集 $S - \{p_i\}$ 的宽度 $w_i$。离群点是使得 $w_i$ 最小的点。请以实数形式报告该最小宽度 $w_i$。

输入格式

第一行包含一个整数 $n$ ($5 \le n \le 100\,000$),表示石头的数量。

接下来的 $n$ 行,每行包含两个整数,表示石头 $p_i$ ($1 \le i \le n$) 的 $x$ 和 $y$ 坐标。

第 $i+1$ 行包含点 $p_i$ 的坐标,其整数标识符为 $i$ ($1 \le i \le n$)。

石头的坐标是不同的,即对于任意两块石头 $p_i$ 和 $p_j$ ($i \neq j$),满足 $x_i \neq x_j$ 或 $y_i \neq y_j$。

坐标值为 $-10^7$ 到 $10^7$ 之间的整数。所有石头的坐标均不相同。

输出格式

输出一行,包含移除离群点后石头集合的宽度 $w$(实数),要求尽可能高的精度。如果你的答案与标准答案的绝对误差或相对误差小于 $10^{-9}$,则判定为正确。

样例

样例输入 1

12
-4 -8
-9 9
-8 1
2 1
1 -3
-8 -9
-1 -3
1 9
4 4
-10 -1
-1 -9
4 2

样例输出 1

11.50372185157

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.