QOJ.ac

QOJ

実行時間制限: 1.0 s メモリ制限: 2048 MB 満点: 100

#16470. 柱子

統計

在以 $(0, 0, 0)$ 为中心、半径为 $R$ 的球面上有 $N$ 个圆。第 $i$ 个圆定义为球面与以下平面的交点集合:

  • 该平面通过点 $(X_i, Y_i, Z_i)$。
  • 该平面与向量 $\vec{v} = (X_i, Y_i, Z_i)$ 正交。

保证 $\vec{v} \neq \vec{0}$。

同时保证任意两个圆都不共享任何公共点。

图 E-1:由 $(X_i, Y_i, Z_i)$ 定义的圆

我们定义球面上两点之间的距离如下:

对于连接这两点的球面路径,计算该路径与多少个圆相交。在所有此类路径中,该计数的最小值即为两点之间的距离。

你可以选择球面上的一个点并将其指定为 极点(Pole)。求以下值的最小可能值:

$$\max_{p \in \text{sphere}} \text{distance}(\text{Pole}, p)$$

输入格式

输入按以下格式给出:

N R
X_1 Y_1 Z_1
X_2 Y_2 Z_2
...
X_N Y_N Z_N

数据范围

  • $1 \le N \le 2000$
  • $1 \le R \le 10^6$
  • $0 < \|(X_i, Y_i, Z_i)\| < R$ ($1 \le i \le N$)
  • 任意两个圆不共享任何公共点。
  • 所有输入值均为整数。

输出格式

在一行中输出答案。

样例

输入样例 1

5 100
14 -11 -2
-54 46 8
54 -57 -12
-34 39 7
64 -74 -4

输出样例 1

3

图 E-2:样例输入示意图

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.