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$ から円弧までの距離を小数点以下 3 桁まで出力してください。出力と正解出力の間の誤差は最大 $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.