CF1936F.Grand Finale: Circles

NOI/NOI+/CTSC

通过率:0%

时间限制:2.00s

内存限制:512MB

AC君温馨提醒

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

题目描述

You are given nn circles on the plane. The ii-th of these circles is given by a tuple of integers (xi,yi,ri)(x_i, y_i, r_i), where (xi,yi)(x_i, y_i) are the coordinates of its center, and rir_i is the radius of the circle.

Please find a circle CC which meets the following conditions:

  • CC is contained inside all nn circles given in the input.
  • Among all circles CC that meet the first condition, the radius of the circle is maximum.

Let the largest suitable circle have the radius of aa.

Your output CC, described as (x,y,r)(x,y,r), will be accepted if it meets the following conditions:

  • For each ii, (xi−x)2+(yi−y)2+r≤ri+max⁡(a,1)⋅10−7\sqrt{(x_i-x)^2+(y_i-y)^2}+ r \le r_i+\max(a,1)\cdot 10^{-7}.
  • The absolute or relative error of rr does not exceed 10−710^{-7}. Formally, your answer is accepted if and only if ∣r−a∣max⁡(1,a)≤10−7\frac{\left|r - a\right|}{\max(1, a)} \le 10^{-7}.

平面上给出 nn 个圆。其中第 ii 个圆由整数三元组 (xi,yi,ri)(x_i, y_i, r_i) 给出,(xi,yi)(x_i, y_i) 表示其圆心坐标,rir_i 表示其半径。

请找出一个圆 CC,使其满足以下条件:

  • CC 完全包含于输入给出的全部 nn 个圆内;
  • 在所有满足第一条条件的圆中,CC 的半径最大。

设满足条件的最大圆的半径为 aa。

你输出的圆 CC(以三元组 (x,y,r)(x, y, r) 描述)若满足以下条件,则视为正确:

  • 对每个 ii,有 (xi−x)2+(yi−y)2+r≤ri+max⁡(a,1)⋅10−7\sqrt{(x_i-x)^2+(y_i-y)^2}+ r \le r_i+\max(a,1)\cdot 10^{-7};
  • rr 的绝对误差或相对误差不超过 10−710^{-7}。形式化地,当且仅当 ∣r−a∣max⁡(1,a)≤10−7\frac{\left|r - a\right|}{\max(1, a)} \le 10^{-7} 时,你的答案被接受。

输入格式

The first line contains a single integer nn (1≤n≤1051 \le n \le 10^5) — the number of circles.

The ii-th of the following nn lines contains three integers xix_i, yiy_i, rir_i (−106≤xi,yi≤106-10^6 \le x_i,y_i \le 10^6, 1≤ri≤2⋅1061 \le r_i \le 2 \cdot 10^6).

It is guaranteed that there is a circle with a radius of at least 10−610^{-6} which is contained inside all nn circles.

第一行包含一个整数 nn(1≤n≤1051 \le n \le 10^5)—— 圆的个数。

接下来的 nn 行中,第 ii 行包含三个整数 xix_i、yiy_i、rir_i(−106≤xi,yi≤106-10^6 \le x_i,y_i \le 10^6,1≤ri≤2⋅1061 \le r_i \le 2 \cdot 10^6)。

保证存在一个半径至少为 10−610^{-6} 的圆,它被包含在全部 nn 个圆的内部。

输出格式

Output three real values, xx, yy, and rr — the coordinates of the center and the radius of the circle.

输出三个实数值 xx、yy 和 rr —— 分别为圆心的坐标和圆的半径。

输入输出样例

  • 输入#1

    4
    1 1 3
    -1 1 3
    1 -1 2
    -1 -1 2

    输出#1

    0.0000000000000000 -0.7637626158259733 0.9724747683480533
  • 输入#2

    4
    41580 -23621 95642
    -41580 -23621 95642
    0 47821 95642
    0 0 109750

    输出#2

    0.0000000000000000 0.0000000000000000 47821.0000000000000000

说明/提示

A two-dimensional plot depicting the first test case is given below. The output circle CC is dashed with blue lines.

A two-dimensional plot depicting the second test case is given below. The output circle CC is dashed with blue lines.

下面给出了第一个测试用例的二维示意图。输出圆 CC 以蓝色虚线绘制。

下面给出了第二个测试用例的二维示意图。输出圆 CC 以蓝色虚线绘制。

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

首页