QOJ.ac

QOJ

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

#3772. 点到圆弧的距离

Statistics

输入一个点 $P$ 和一条圆弧(圆周的一部分),你的任务是计算 $P$ 到圆弧的最短距离。换句话说,你需要在圆弧上找一个点,到 $P$ 点的距离最小。

提示: 请尽量使用精确算法。相比之下,近似算法更难通过本题的数据。

输入格式

输入包含最多 10000 组数据。每组数据包含 8 个整数 $x_1, y_1, x_2, y_2, x_3, y_3, x_p, y_p$。圆弧的起点是 $A(x_1,y_1)$,经过点 $B(x_2,y_2)$,结束位置是 $C(x_3,y_3)$。点 $P$ 的位置是 $(x_p,y_p)$。输入保证 $A, B, C$ 各不相同且不会共线。上述所有点的坐标绝对值不超过 $20$。

输出格式

对于每组数据,输出测试点编号和 $P$ 到圆弧的距离,保留三位小数。你的输出和标准输出之间最多能有 $0.001$ 的误差。

样例

输入格式 1

0 0 1 1 2 0 1 -1
3 4 0 5 -3 4 0 1

输出格式 1

Case 1: 1.414
Case 2: 4.000

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.