poj2031-Building a Space Station(最小生成树,kruskal,prime)
Time Limit: 1000MS | Memory Limit: 30000K | |
Total Submissions: 5874 | Accepted: 2914 |
Description
The space station is made up with a number of units, called cells. All cells are sphere-shaped, but their sizes are not necessarily uniform. Each cell is fixed at its predetermined position shortly after the station is successfully put into its orbit. It is
quite strange that two cells may be touching each other, or even may be overlapping. In an extreme case, a cell may be totally enclosing another one. I do not know how such arrangements are possible.
All the cells must be connected, since crew members should be able to walk from any cell to any other cell. They can walk from a cell A to another cell B, if, (1) A and B are touching each other or overlapping, (2) A and B are connected by a `corridor', or
(3) there is a cell C such that walking from A to C, and also from B to C are both possible. Note that the condition (3) should be interpreted transitively.
You are expected to design a configuration, namely, which pairs of cells are to be connected with corridors. There is some freedom in the corridor configuration. For example, if there are three cells A, B and C, not touching nor overlapping each other, at least
three plans are possible in order to connect all three cells. The first is to build corridors A-B and A-C, the second B-C and B-A, the third C-A and C-B. The cost of building a corridor is proportional to its length. Therefore, you should choose a plan with
the shortest total length of the corridors.
You can ignore the width of a corridor. A corridor is built between points on two cells' surfaces. It can be made arbitrarily long, but of course the shortest one is chosen. Even if two corridors A-B and C-D intersect in space, they are not considered to form
a connection path between (for example) A and C. In other words, you may consider that two corridors never intersect.
Input
n
x1 y1 z1
posted on 2017-06-19 10:53 cynchanpin 阅读(...) 评论(...) 编辑 收藏
var allowComments=true,cb_blogId=347763,cb_entryId=7047739,cb_blogApp=currentBlogApp,cb_blogUserGuid='43c87c18-831e-e711-9fc1-ac853d9f53cc',cb_entryCreatedDate='2017/6/19 10:53:00';loadViewCount(cb_entryId);var cb_postType=1;var isMarkdown=false;
poj2031-Building a Space Station(最小生成树,kruskal,prime)的更多相关文章
- POJ2031 Building a Space Station 2017-04-13 11:38 48人阅读 评论(0) 收藏
Building a Space Station Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 8572 Accepte ...
- POJ 2031 Building a Space Station (最小生成树)
Building a Space Station Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 5173 Accepte ...
- POJ 2031:Building a Space Station 最小生成树
Building a Space Station Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 6083 Accepte ...
- POJ-2031 Building a Space Station (球的最小生成树)
http://poj.org/problem?id=2031 Description You are a member of the space station engineering team, a ...
- Building a Space Station(kruskal,说好的数论呢)
Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 3820 Accepted: 1950 Description You a ...
- POJ - 2031C - Building a Space Station最小生成树
You are a member of the space station engineering team, and are assigned a task in the construction ...
- POJ Building a Space Station 最小生成树
Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 15664 Accepted: 6865 Description You ...
- POJ2031 Building a Space Station【最小生成树】
题意: 就是给出三维坐标系上的一些球的球心坐标和其半径,搭建通路,使得他们能够相互连通.如果两个球有重叠的部分则算为已连通,无需再搭桥.求搭建通路的最小边长总和是多少. 思路: 先处理空间点之间的距离 ...
- poj2031 Building a Space Station
这题目,用G++ WA,用C++ AC. 题目要求,现给出n个球,然后要使每两个球直接或者间接连通,可以在任意两球之间做管道(在表面),最后的要求是,如果使得都连通的话,管道最小长度是多少. 思路简单 ...
- POJ 2031 Building a Space Station 最小生成树模板
题目大意:在三维坐标中给出n个细胞的x,y,z坐标和半径r.如果两个点相交或相切则不用修路,否则修一条路连接两个细胞的表面,求最小生成树. 题目思路:最小生成树树模板过了,没啥说的 #include& ...
随机推荐
- category和关联对象
如上所见,我们知道在category里面是无法为category添加实例变量的.但是我们很多时候需要在category中添加和对象关联的值,这个时候可以求助关联对象来实现. MyClass+Categ ...
- python一些被我忽略的知识
最后一个不小心打错了,刚看到,try ...else 与 while/for else的相同
- php xml 的基本操作类
class xmlMessage{ protected $doc; protected $rootKey; public function __construct() { $this->doc ...
- SP687 REPEATS - Repeats(后缀数组)
一个初步的想法是我们枚举重复子串的长度\(L\).然后跑一遍SA.然后我们枚举一个点\(i\),令他的对应点为\(i+L\),然后求出这两个点的LCP和LCS的长度答案就是这个点的答案就是\((len ...
- parted 4T磁盘
parted /dev/vdg mklabel gpt mkpart primary ext4 0% 100%
- Valgrind的安装及简单使用
1.获取源码 wget http://www.valgrind.org/downloads/valgrind-3.14.0.tar.bz2 2.解压缩 tar -jxvf valgrind-3.14. ...
- URAL 2027 2028 两个有趣的题
这两个题,讲的是有一种奇怪的语言,代码是一种二维的矩阵. 前一个题,是根据所给的要求,写一个简单的解释器. 后一个题,是用那种语言写一个简单的小程序. 挺有意思的,所以在这里纪念一下.顺便那个语言的原 ...
- 2015 Multi-University Training Contest 2 Friends
Friends Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Sub ...
- 洛谷 P1193 洛谷团队训练VS传统团队训练
P1193 洛谷团队训练VS传统团队训练 题目背景 “在中学的信息学教育领域,洛谷无疑是一个相当受欢迎的辅助网站.同时有百余所学校正在通过洛谷进行信息学竞赛(以后简称OI)的教育.洛谷之所以如此受欢迎 ...
- [MST] Derive Information from Models Using Views
Redundant data or caching data is a constant source of bugs. MST adheres to the philosophy that no d ...