QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 128 MB Total points: 100

#4139. 最近最远点对

统计

给定平面直角坐标系上的 $n$ 个点,分别求出距离最近的两个点的距离和距离最远的两个点的距离。注意,距离为直线距离。

输入格式

第一行一个整数,$n$。

接下来 $n$ 行每行两个非负浮点数,$x_i$,$y_i$,表示第 $i$ 个点的 X 坐标与 Y 坐标。

输出格式

总共一行,两个浮点数,为最短距离与最长距离。误差不超过 $0.01$ 视为正确。

样例数据

样例输入

4
0.0 0.0
0.0 1.0
1.0 0.0
1.0 1.0

样例输出

1.00 1.41

子任务

  • 对于 $30\%$ 的数据,$n\leq 2000$
  • 对于 $70\%$ 的数据,$n\leq 20000$
  • 对于 $100\%$ 的数据,$0 \lt n\leq 10^5$,输入数据中所有数均为不超过 $10^9$ 的非负数

Discussions

About Discussions

The discussion section is only for posting: Editorials, 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. Submitting multiple issues may cause your account to be banned.
  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.