TopCoder

FHVirus
想像不出自己 AC 的題目是實作不出來的!

User's AC Ratio

79.2% (168/212)

Submission's AC Ratio

18.4% (516/2806)

Tags

Description

It's perfectly normal, nothing wrong with me
But we're going to need a clean up on aisle 3
And now I'm posed in an awkward stance because I

據說有位顧客,因為超商的動線設計不良,不小心把東西翻倒在褲子上,使得他要去第三排走廊清理一下。之後超商在檢討為什麼會發生這種事情,他們發現若有兩兩障礙物離太近就會有奇怪的顧客,故意從兩障礙的夾縫中走過去,就會發生意外。

你就是那位奇怪的顧客,你想知道兩障礙物最近的距離是多少。好穿越最近的夾縫獲得成就感。

Input Format

可以把超商整個平面當作一個平面座標。

接著一個正整數 $N$($N<50000$) 告訴你有幾個障礙物,在來告訴你每個障礙物的座標 $X_i, Y_i$(其中 $X_i, Y_i$ 都可用有號的 32-bit integer 儲存)

Output Format

輸出距離兩個障礙物最近的距離是多少。精準到小數第六位。

Sample Input 1

5
1 2
2 3
3 4
4 5
5 6
3
-1 10
-2 25
3 8

Sample Output 1

1.414214
4.472136

Hints

Problem Source

原TIOJ1500 / problem setter: godgunman

Subtasks

No. Testdata Range Score
1 0 14
2 1 14
3 2 14
4 3 14
5 4 14
6 5 14
7 6 16

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 5000 65536 262144 1
1 5000 65536 262144 2
2 5000 65536 262144 3
3 5000 65536 262144 4
4 5000 65536 262144 5
5 5000 65536 262144 6
6 5000 65536 262144 7