当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6250:Equidistance

Special Judge 特殊评判
题目描述
Given $M$ points in Euclidean space of dimension N, where the distances between any pair of points is 1.0, how many points can be added that the equidistance restriction still holds?
Print the maximum number of points can be added, and the coordinates of the points. Recall that the distance of two points $(a_1, a_2, . . . , a_N)$ and $(b_1, b_2, . . . , b_N)$ in $N$ dimensional Euclidean space is defined as:
$\sqrt{(a_1-b_1)^2+(a_2-b_2)^2+...+(a_N-b_N)^2}$
输入解释
The first line of the input gives the number of test cases, $T$. $T$ test cases follow.
The first line of each test case contains two integer $N$ and $M$, indicating the dimension of the Euclidean space and the number of given points. Then follows $M$ lines, each line contains $N$ real numbers indicating the coordinates of the given points. It is guaranteed that the distances between any two given points is 1.0.
$1 \leq T \leq 100$
$1 \leq N \leq 100$
$1 \leq M$
The coordinates’ absolute value of given points will be strictly less than 100.
输出解释
For each test case, output one line containing “Case #x: y”, where $x$ is the test case number (starting from 1) and $y$ is the maximum number of points can be added that the equidistance restriction still holds. The following $y$ lines each contains $N$ real numbers specifying the coordinates of the added points. There could be multiple answers to the given input. The answer is accepted as long as for each pair of points, the absolute difference between the distance and 1.0 is smaller than $10^{-8}$.
输入样例
2
1 1
0.0000000000
2 2
1.0000000000 0.0000000000
2.0000000000 0.0000000000
输出样例
Case #1: 1
1.0000000000
Case #2: 1
1.5000000000 0.8660254038
来自杭电HDUOJ的附加信息
Recommend liuyiding

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6250

最后修改于 2020-10-25T23:29:41+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
4000/2000MS(Java/Others) 65536/65536K(Java/Others)