QOJ.ac

QOJ

Límite de tiempo: 1.0 s Límite de memoria: 512 MB Puntuación total: 100

#15961. 移动

Estadísticas

著名的移动网络运营商 Totalphone 建立了一些新的基站,以便用其网络覆盖一条新建的高速公路。像往常一样,Totalphone 的程序员们工作很马虎;结果,每个基站的发射功率无法单独设置,只能将所有基站的发射功率设置为一个固定的公共值。为了最小化功耗,公司想知道高速公路上任意一点到最近基站的最大距离。

输入格式

第一行包含两个整数 $N$ ($1 \le N \le 10^6$) 和 $L$ ($1 \le L \le 10^9$),分别表示基站的数量和高速公路的长度。

接下来 $N$ 行,每行包含一对整数 $x_i, y_i$ ($-10^9 \le x_i, y_i \le 10^9$),描述一个基站的坐标。所有点都是互不相同的。坐标已按 $x_i$ 坐标非递减的顺序排序。如果两个 $x_i$ 的值相同,则按 $y_i$ 坐标升序排序。

高速公路是连接 $(0, 0)$ 到 $(L, 0)$ 的一条线段。

输出格式

输出仅包含一个实数,表示高速公路上任意一点到最近基站的最大距离。如果你的输出与精确结果的绝对误差不超过 $10^{-3}$,则被视为正确。

样例

输入样例 1

2 10
0 0
11 1

输出样例 1

5.545455

子任务

  • 对于 $N \le 5000$ 的测试用例,占 25 分。
  • 对于 $N \le 100000$ 的测试用例,占 50 分。

说明

在计算中请至少使用双精度浮点数,因为精度较低的类型可能无法达到解决该问题所需的精度要求。

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
EditorialOpen Official EditorialQingyu- Download

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.