当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

1589:Stars Couple

题目描述
Can you believe it? After Gardon had solved the problem, Angel accepted him! They were sitting on the lawn, watching the stars.
"I still can't believe this!" Gardon said.
Angel smiled and said: "The reason why I love you does not rest on of who you are, but on who I am when I am with you."
Gardon answered :"In my view, it's not because I'm lonely and it's not because it's the Valentine's Day. It's because when you realize you want to spend the rest of your life with somebody, you want the rest of your life to start as soon as possible!"
"Watch the stars! How beautiful!"
"Just like your eyes!" Gardon replied.
Angel smiled again:" Did you hear about this: one star means one person. When two people fall in love, their stars will be always nearby."
"So we are the nearest couple?"
Now there is the question. Can you point out which couple of stars is nearest? Besides, can you fingle out which couple are most distant?
输入解释
Input contains serveral test cases. Each cases starts with a integer N (2<=N<=50,000). Then N lines follow. Each line have two integers Xi and Yi(-10^9<Xi,Yi<10^9), which show the position of one star.
The input will be ended with a integer 0.
输出解释
For each case, print the distance of the nearest couple and the most distant couple.
Print a blank line after each case.
输入样例
3
1 1
0 0
0 1
0
输出样例
Case 1:
Distance of the nearest couple is 1.000
Distance of the most distant couple is 1.414


Please use scanf instead of cin.
来自杭电HDUOJ的附加信息
Author DYGG
Recommend linle

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-1589

最后修改于 2020-10-25T22:46:16+00:00 由爬虫自动更新

共提交 42

通过率 4.76%
时间上限 内存上限
1000/2000MS(Java/Others) 32768/32768K(Java/Others)