CF106E.Space Rescuers

提高+/省选-

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

The Galaxy contains n planets, there are many different living creatures inhabiting each planet. And each creature can get into troubles! Space rescuers know it perfectly well and they are always ready to help anyone who really needs help. All you need to do is call for them.

Now the space rescuers plan to build the largest in the history of the Galaxy rescue station; however, the rescue station's location is yet to be determined. As some cases are real emergencies, the rescuers want to find such a point in the Galaxy from which it would be possible to get to the remotest planet in the minimum possible time. In other words, the rescuers need such point in the space that the distance between it and the planet remotest from it was minimal (if we compare this point with all other possible points in the space). Unfortunately, the rescuers can't sole this problem.

As the planets are quite remote from each other, they can be considered as points in Euclidean three-dimensional space. The distance between points (x__i, y__i, z__i) and (x__j, y__j, z__j) can be calculated by the formula . The rescue station can be positioned in any point in the space. It can also coincide with some planet.

Galaxy is in danger! Save the space rescuers and find the required point for them.

银河系中有 nn 颗行星,每颗行星上都栖息着多种不同的生命体。而每个生命体都可能陷入困境!太空救援队对此了如指掌,他们始终准备着为任何真正需要帮助的生命体提供援助——你只需向他们发出求救信号即可。

目前,太空救援队计划建造银河系历史上规模最大的救援站;然而,该救援站的具体位置尚未确定。由于部分情况属于真正的紧急事件,救援队希望找到银河系中的一个点,使得从该点出发抵达最远行星所需的时间最短。换言之,救援队需要在空间中找到这样一个点,使得该点到其最远行星的距离(在所有可能的空间点中)达到最小。遗憾的是,救援队无法独立解决这一问题。

由于各行星彼此相距遥远,因此可将它们视为三维欧几里得空间中的点。点 (xi, yi, zi)(x_i,\,y_i,\,z_i) 与点 (xj, yj, zj)(x_j,\,y_j,\,z_j) 之间的距离可通过公式 计算。救援站可建于空间中任意一点,甚至可以与某颗行星的位置重合。

银河系正处于危险之中!请拯救太空救援队,并为他们找出所需的这个点。

输入格式

The first line of the input file contains integer n — the number of planets (1 ≤ N ≤ 100). Each of the following n lines contains information about the planets. The i-th line contains three integers x__i, y__i, z__i — the coordinates of the i-th planet ( - 104 ≤ x__i, y__i, z__i ≤ 104, 1 ≤ i ≤ n). No two planets coincide.

输入文件的第一行包含一个整数 nn —— 行星的数量(1≤n≤1001 \leq n \leq 100)。接下来的 nn 行每行包含一颗行星的信息。第 ii 行包含三个整数 xi, yi, zix_i,\ y_i,\ z_i —— 第 ii 颗行星的坐标(−104≤xi, yi, zi≤104-10^4 \leq x_i,\ y_i,\ z_i \leq 10^4,1≤i≤n1 \leq i \leq n)。任意两颗行星的位置均不重合。

输出格式

Print on the first line of the output file three space-separated real numbers _x_0, _y_0, _z_0 — the coordinates for the future base. If there are several solutions, you are allowed to print any of them. The answer will be accepted if the distance from this point to the remotest planet will differ from the juries' variant in no more than 10 - 6 in absolute or relative value.

在输出文件的第一行打印三个用空格分隔的实数 x0, y0, z0x_0,\ y_0,\ z_0 —— 未来基地的坐标。若存在多个解,可任选其一输出。只要该点到最远行星的距离与评测组答案的绝对误差或相对误差均不超过 10−610^{-6},即视为正确。

输入输出样例

  • 输入#1

    5
    5 0 0
    -5 0 0
    0 3 4
    4 -3 0
    2 2 -2

    输出#1

    0.000 0.000 0.000

输入解题思路,AI测评打分。不知道怎么写?

首页