QOJ.ac

QOJ

Límite de tiempo: 5 s Límite de memoria: 2048 MB Puntuación total: 100

#5136. 最低延迟

Estadísticas

现在是 2222 年。整个宇宙都已被探索,每一颗行星上都建立了定居点。你居住在其中一个定居点中。虽然生活在各方面都很舒适,但有一个严峻的问题:与其他行星之间的互联网连接延迟太高了。

幸运的是,你想到了一种解决这个问题的方法:你只需要在所有行星之间铺设“捆绑式天文配对电缆”(Bonded, Astronomically Paired Cables),互联网就会变得超级快!然而,当你开始开发这个想法时,你发现要在两颗行星之间建造电缆比预想的要困难。因此,你希望你的第一个电缆原型连接的是两颗距离尽可能近的行星。

从天文学课上你了解到,宇宙最好被建模为一个边长为 $10^9$ 光年的大立方体。宇宙中恰好有 $10^5$ 颗静止的行星,它们完全随机地分布在宇宙中(更准确地说:所有行星的坐标都是在 $0$ 到 $10^9$ 之间独立均匀分布的随机整数)。

给定行星在宇宙中的随机位置,你的目标是找出任意两颗行星之间的最小欧几里得距离。

连接地球与其他行星的电缆。图片由 PxFuel 提供,经修改,可免费使用。

输入格式

输入包含: 一行一个整数 $n$,表示行星的数量。 $n$ 行,每行三个整数 $x, y, z$ ($0 \le x, y, z < 10^9$),表示一颗行星的坐标。

你的提交将在 100 个测试用例上运行,所有测试用例均满足 $n = 10^5$。样例数据较小,仅供说明。

你的每一次提交都将在新的随机测试用例上运行。

说明:QOJ 上的测试用例是预先固定的。

输出格式

输出任意两颗行星之间的最小欧几里得距离。

你的答案应具有不超过 $10^{-6}$ 的绝对或相对误差。

样例

样例输入 1

5
10 5 1
8 2 0
4 7 5
1 0 9
0 10 7

样例输出 1

3.7416573867739413

样例输入 2

3
790726336 656087587 188785845
976472310 22830435 160538063
211966015 87530388 542618498

样例输出 2

660540781.9387681

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.