QOJ.ac

QOJ

Limite de temps : 20 s Limite de mémoire : 1024 MB Points totaux : 50

#6012. 放射性岛屿

Statistiques

你正在驾驶一艘船从坐标 $(-10, A)$ 前往坐标 $(10, B)$。坐标单位为千米,船以每小时 $1$ 千米的速度匀速行驶。你可以完全控制船的航行路径。我们将船视为一个点。

该区域内有 $N$ 个岛屿,我们也将它们视为点。第 $i$ 个岛屿位于坐标 $(0, C_i)$。

该区域具有放射性,无论你身处何处,都会持续受到来自环境的每小时 $1$ 微西弗的辐射。此外,岛屿本身也具有放射性,你会从第 $i$ 个岛屿受到额外的辐射,辐射率为每小时 $(D_i)^{-2}$ 微西弗,其中 $D_i$ 是你当前距离第 $i$ 个岛屿的距离(单位为千米)。(形式化地:设 $D_i(t)$ 为你在时间 $t$ 时距离第 $i$ 个岛屿的距离,设 $X$ 为航行总时间。则从第 $i$ 个岛屿受到的总辐射量为 $D_i(t)^{-2}$ 从 $0$ 到 $X$ 的定积分。)只要不与岛屿坐标完全重合,你可以无限接近岛屿。

请找出在最优航线规划下,你所能受到的最小总辐射剂量。

输入格式

输入的第一行包含测试用例的数量 $T$。接下来是 $T$ 个测试用例。每个测试用例包含两行:第一行包含三个值:一个整数 $N$,以及两个浮点数 $A$ 和 $B$。第二行包含 $N$ 个浮点数 $C_i$,其中第 $i$ 个数表示第 $i$ 个岛屿的 $y$ 坐标。

所有浮点数均精确到小数点后两位。

输出格式

对于每个测试用例,输出一行 Case #x: y,其中 $x$ 是测试用例编号(从 $1$ 开始),$y$ 是完成航行过程中受到的最小辐射剂量(单位为微西弗)。

如果 $y$ 与正确答案的绝对误差或相对误差在 $10^{-3}$ 以内,则视为正确。

数据范围

内存限制:1 GB。 $-10.00 \le A \le 10.00$。 $-10.00 \le B \le 10.00$。 $-10.00 \le C_i \le 10.00$,对于所有 $i$。 $C_i \neq C_j$,对于所有 $i \neq j$。

子任务 1

时间限制:120 秒。 $T \le 20$; $N = 1$。

子任务 2

时间限制:240 秒。 $T \le 50$; $1 \le N \le 2$。

样例

样例输入 1

2
1 1.00 -2.00
0.00
2 0.00 0.00
3.00 -3.00

样例输出 1

Case #1: 21.806
Case #2: 21.706

说明

这是样例 #1 最优路径的示意图。我们将岛屿放大以便观察,但请记住将其视为一个点。

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.