QOJ.ac

QOJ

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

#4139. 最近最远点对

Statistics

给定平面直角坐标系上的 $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$ 的非负数
About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.