QOJ.ac

QOJ

Time Limit: 6 s Memory Limit: 1024 MB Total points: 100

#5588. 侵蚀的柱子

Statistics

你身处一个混乱的境地,更准确地说,是一个充满了破旧且不稳定的石柱的洞穴。幸运的是,你正站在洞穴中央的一块坚固岩石上。你知道其中一根石柱上藏有珍贵的文物,但目前还不确定是哪一根。在等待洞穴扫描结果的同时,你开始制造一个机器人来帮助你取回文物。

你制造的机器人很轻,它肯定能够至少在每根石柱上着陆并跳跃一次。为了制造机器人,你需要确定它在跳跃距离方面的能力。如果机器人太弱,它可能无法到达某根石柱;如果机器人太强,它在跳跃和着陆时会造成很大的破坏。

幸运的是,你已经绘制出了所有石柱相对于你起始位置 $(0, 0)$ 的坐标。你还不知道哪根石柱藏有文物,并且你需要在扫描结束前完成机器人的制造。

给定所有石柱的位置,你需要确定最小的跳跃距离,以保证你的机器人能够到达任意一根石柱并返回起点,且过程中不会在同一根石柱上着陆两次。

输入格式

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

接下来的 $n$ 行,每行包含两个整数 $x$ 和 $y$ ($-10^9 \le x, y \le 10^9$),表示石柱的 $(x, y)$ 坐标。所有石柱的位置各不相同,且没有石柱位于 $(0, 0)$。

输出格式

输出一个数字,表示为了保证机器人能够到达任意一根石柱并返回起点,且不重复着陆于同一石柱,所需的最小跳跃距离。如果你的答案与标准答案的绝对误差或相对误差不超过 $10^{-6}$,则会被接受。

样例

样例输入 1

2
1 1
1 0

样例输出 1

1.414213562373095

样例输入 2

8
1 1
0 1
1 0
2 0
0 2
2 1
1 2
2 2

样例输出 2

1.0

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.