QOJ.ac

QOJ

Límite de tiempo: 3.0 s Límite de memoria: 512 MB Puntuación total: 100

#8614. 3D

Estadísticas

有 $n$ 个点 $a_1, a_2, \dots, a_n$ 在一个大小为 1 的立方体内随机生成。 给定一个矩阵 $d$,其中 $d_{i,j} = d_{j,i} = \text{dist}(a_i, a_j) + \text{rand}(-0.1..0.1)$ 且 $d_{i,i} = 0$。这里 $\text{dist}(p, q)$ 是点之间的距离 $\sqrt{(p_x - q_x)^2 + (p_y - q_y)^2 + (p_z - q_z)^2}$,而 $\text{rand}(-0.1..0.1)$ 是从区间 $[-0.1, 0.1]$ 中均匀随机选择的偏移量。不同点对的偏移量是独立选择的。 你需要构造一个点列表 $b_1, b_2, \dots, b_n$,使得对于所有 $i, j$ 满足 $|\text{dist}(b_i, b_j) - d_{i,j}| \le 0.1$。

输入格式

第一行包含一个整数 $n$ ($1 \le n \le 10$),表示点的数量。 接下来的 $n$ 行包含矩阵 $d$ 的描述。第 $i$ 行包含 $n$ 个实数 $d_{i,j}$ ($-0.1 \le d_{i,j} \le \sqrt{3} + 0.1$)。每个值给出小数点后 6 位。 保证 $d_{i,i} = 0$ 且 $d_{i,j} = d_{j,i}$。

输出格式

输出 $n$ 行描述这些点。第 $i$ 行应包含三个实数 $x_i, y_i, z_i$ ($-10.0 \le x_i, y_i, z_i \le 10.0$)。

样例

输入 1

4
0.000000 0.758400 0.557479 0.379026
0.758400 0.000000 0.516608 0.446312
0.557479 0.516608 0.000000 0.554364
0.379026 0.446312 0.554364 0.000000

输出 1

0.210269 0.581333 0.000000
0.090086 0.000000 0.458722
0.000000 0.498388 0.501723
0.204618 0.204262 0.075724

说明

本题共有 30 个测试用例。

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.