QOJ.ac

QOJ

حد الوقت: 20 s - 40 s حد الذاكرة: 1024 MB مجموع النقاط: 20

#5809. 最小周长

الإحصائيات

给定一组具有整数坐标的点。你需要计算由这些点中互不相同的三个顶点所构成的三角形的最小周长。

输入格式

输入数据的第一行包含测试用例的数量 $T$。接下来是 $T$ 个测试用例。每个测试用例的第一行包含一个整数 $n$,表示点的数量。接下来的 $n$ 行,每行包含两个整数 $x_i, y_i$,表示第 $i$ 个点的坐标。不会有多个点位于同一坐标。

输出格式

对于每个测试用例,输出:

Case #$X$: $Y$

其中 $X$ 是测试用例的编号,$Y$ 是最小周长。相对误差或绝对误差不超过 $10^{-5}$ 的答案将被视为正确。退化三角形(面积为零的三角形)也是允许的。

数据范围

$1 \le T \le 15$

$0 \le x_i, y_i \le 10^9$

小数据集(5 分)

$3 \le n \le 10000$

大数据集(15 分)

$3 \le n \le 1000000$

样例

样例输入 1

1
10
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9

样例输出 1

Case #1: 5.656854

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.