poj 2560 Freckles
来源:互联网 发布:淘宝旺旺客服设置 编辑:程序博客网 时间:2024/05/12 19:11
Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 5778 Accepted: 2942
Description
In an episode of the Dick Van Dyke show, little Richie connects the freckles on his Dad's back to form a picture of the Liberty Bell. Alas, one of the freckles turns out to be a scar, so his Ripley's engagement falls through.
Consider Dick's back to be a plane with freckles at various (x,y) locations. Your job is to tell Richie how to connect the dots so as to minimize the amount of ink used. Richie connects the dots by drawing straight lines between pairs, possibly lifting the pen between lines. When Richie is done there must be a sequence of connected lines from any freckle to any other freckle.
Consider Dick's back to be a plane with freckles at various (x,y) locations. Your job is to tell Richie how to connect the dots so as to minimize the amount of ink used. Richie connects the dots by drawing straight lines between pairs, possibly lifting the pen between lines. When Richie is done there must be a sequence of connected lines from any freckle to any other freckle.
Input
The first line contains 0 < n <= 100, the number of freckles on Dick's back. For each freckle, a line follows; each following line contains two real numbers indicating the (x,y) coordinates of the freckle.
Output
Your program prints a single real number to two decimal places: the minimum total length of ink lines that can connect all the freckles.
Sample Input
31.0 1.02.0 2.02.0 4.0
Sample Output
3.41
Source
Waterloo local 2000.09.23
- Poj 2560 Freckles
- poj 2560 Freckles
- POJ 2560 Freckles
- POJ 2560 Freckles
- POJ-2560 Freckles
- POJ 2560 Freckles
- poj 2560 Freckles
- POJ 2560 Freckles
- POJ 2560 Freckles
- POJ 2560 Freckles
- poj 2560 Freckles
- poj 2560 Freckles
- poj 2560 Freckles
- poj 2560Freckles (krusual)
- poj 2560 uva 10034 - Freckles
- POJ-2560-Freckles 解题报告
- POJ 2560 Freckles 最小生成树
- POJ 2560 Freckles
- 进制转换_十进制转二进制_二进制转十进制_十进制转十六进制_十进制转八进制
- 最小树Prime算法
- 使用有限多例模式管理数据库结构信息
- NYOJ - 数乌龟
- Hadoop读写过程详细代码
- poj 2560 Freckles
- 海量数据的二度人脉挖掘算法(Hadoop 实现)
- [原创]FCKeditor上传路径从绝对路径改成相对路径的方法
- Golden Gate入门指导:概念和体系结构篇
- [Leetcode] Recover Binary Search Tree
- Hadoop学习总结之四:Map-Reduce的过程解析
- Linux 压缩与解压缩
- [苹果系统mac os + win7] win7分C,D盘后,mac os 启动项消失
- [Leetcode] Permutations