QOJ.ac

QOJ

Time Limit: 4 s Memory Limit: 1024 MB Total points: 100

#3962. 100米短跑

Statistics

作为计算机专业的学生,我们整天坐在屏幕前。这在很多方面对我们都不利:背痛、需要戴眼镜以及缺乏社交生活。根据政府的建议,经常锻炼可以帮助解决其中一些问题。尽管你坚信事实并非如此,但你还是决定开始跑步,并使用 Ztrawa GPS 追踪移动应用程序来记录你的跑步情况。

Ztrawa 会以随机的时间间隔存储你的位置坐标 $(x, y)$。当你跑完步后,你可以查看许多很酷的统计数据,例如海拔提升、最快 100 米用时以及从 A 点到 B 点的平均速度。

由于所有计算机专业的学生都喜欢对一切事物进行极值分析(Min-Max),你只对跑步过程中最快的 100 米感兴趣。遗憾的是,你的 Ztrawa 应用程序出了故障,极值分析功能停止工作了,所以你需要自己计算出来。

由于 Ztrawa 只收集有限数量的数据点,我们假设在两个连续数据点之间保持匀速运动。例如,假设你在一个 400 米的跑道上跑步,并记录了 6 个数据点,绕跑道跑了一圈并回到了起点。这就是样例 1,我们从左下角开始跑步,并逆时针绕行。

你需要编写自己的程序,以便找出你跑完 100 米的最快用时(以秒为单位)。

样例 1 的示意图。

输入格式

第一行包含一个整数 $1 \le n \le 10^5$,表示来自 Ztrawa 的读数数量。接下来有 $n$ 行,包含每个读数的信息。第 $i$ 行包含三个实数 $x_i, y_i$ 和 $t_i$,表示在第 $i$ 次读数时,你位于相对于起点坐标 $(x_i, y_i)$ 的位置,且自跑步开始以来已经过去了 $t_i$ 秒。对于每个 $i$,满足 $-10^5 \le x_i, y_i \le 10^5$,且 $0 < t_1 < t_2 < \dots < t_n \le 10^7$。

所有实数最多给出 6 位小数。

你始终从时间 0 的 $(0, 0)$ 位置开始跑步。

输出格式

输出一个实数,表示你跑完 100 米的最快用时(以秒为单位)。任何绝对误差或相对误差在 $10^{-4}$ 以内的结果都将被接受。

样例

输入 1

6
84.39 0 10
120.89 36.5 14.3
84.39 73 18.4
0 73 28.5
-36.5 36.5 32.7
0 0 36.95

输出 1

8.130299066033297

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.