QOJ.ac

QOJ

Time Limit: 0.5 s Memory Limit: 512 MB Total points: 100 Hackable ✓

#784. 旋转卡壳

统计

题目描述

以逆时针顺序给定一个 $n$ 个点的凸多边形(可能存在三点共线),求它的直径。

输入格式

输入的第一行包含一个整数 $n$。

接下来 $n$ 行,每行包含两个整数 $x_i,y_i$,描述一个点的坐标。点的坐标按照逆时针的顺序给出。

输出格式

输出一行一个实数,表示答案。当你与标准答案的相对误差不超过 $10^{-6}$ 时将被视为正确。

样例数据

样例 1 输入

3
0 0
4 0
2 2

样例 1 输出

4

样例 2 输入

4
0 0
1 0
1 1
0 1

样例 2 输出

1.414213562373

样例 3 输入

10
0 0
461074 -72768411
3213786 -131277098
9156758 -204048615
50058801 -267750564
98614697 -289078664
138651620 -243972492
191427505 -152569765
131060323 -88251044
85141546 -55035262

样例 3 输出

305436298.50498565947291157209925

子任务

对于所有数据,$3 \leq n \leq 5 \times 10^5$,$-10^9 \le x_i, y_i \le 10^9$。

  • Subtask 1(10 pts): $n \leq 10^3$
  • Subtask 2(30 pts): $n \leq 3 \times 10^4$
  • Subtask 3(60 pts): No additional constraints.
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.