You are a member of the space station engineering team, and are assigned a task in the construction process of the station. You are expected to write a computer program to complete the task. The space station is made up with a number of units, called…
Building a Space Station Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 5173   Accepted: 2614 Description You are a member of the space station engineering team, and are assigned a task in the construction process of the station. You ar…
题目大意:在三维坐标中给出n个细胞的x,y,z坐标和半径r.如果两个点相交或相切则不用修路,否则修一条路连接两个细胞的表面,求最小生成树. 题目思路:最小生成树树模板过了,没啥说的 #include<cstdio> #include<cstdlib> #include<cmath> #include<iostream> #include<algorithm> #include<cstring> #include<vector&g…
链接: http://poj.org/problem?id=2031 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=22013#problem/A Building a Space Station Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 3578   Accepted: 1830 Description You are a member of the s…
Building a Space Station 题目链接: http://acm.hust.edu.cn/vjudge/contest/124434#problem/C Description You are a member of the space station engineering team, and are assigned a task in the construction process of the station. You are expected to write a…
Building a Space Station Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 5699   Accepted: 2855 Description You are a member of the space station engineering team, and are assigned a task in the construction process of the station. You ar…
Building a Space Station Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 6083   Accepted: 3024 Description You are a member of the space station engineering team, and are assigned a task in the construction process of the station. You ar…
3维空间中的最小生成树....好久没碰关于图的东西了.....              Building a Space Station Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 3804   Accepted: 1940 Description You are a member of the space station engineering team, and are assigned a task in th…
Building a Space Station Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 5869 Accepted: 2910 Description You are a member of the space station engineering team, and are assigned a task in the construction process of the station. You are ex…
Building a Space Station You are a member of the space station engineering team, and are assigned a task in the construction process of the station. You are expected to write a computer program to complete the task. The space station is made up with…
题目: Description You are a member of the space station engineering team, and are assigned a task in the construction process of the station. You are expected to write a computer program to complete the task. The space station is made up with a number…
You are a member of the space station engineering team, and are assigned a task in the construction process of the station. You are expected to write a computer program to complete the task. The space station is made up with a number of units, called…
Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 15664   Accepted: 6865 Description You are a member of the space station engineering team, and are assigned a task in the construction process of the station. You are expected to write a co…
Description You are a member of the space station engineering team, and are assigned a task in the construction process of the station. You are expected to write a computer program to complete the task.The space station is made up with a number of un…
http://poj.org/problem?id=2031 题意 给出三维坐标系下的n个球体,求把它们联通的最小代价. 分析 最小生成树加上一点计算几何.建图,若两球体原本有接触,则边权为0:否则边权为它们球心的距离-两者半径之和.这样来跑Prim就ok了.注意精度. #include<iostream> #include<cmath> #include<cstring> #include<queue> #include<vector> #in…
只是坐标变成三维得了,而且要减去两边的半径而已 题目 //最小生成树,只是变成三维的了 #define _CRT_SECURE_NO_WARNINGS #include<stdlib.h> #include<stdio.h> #include<iostream> #include<string.h> #include<algorithm> #include<math.h> using namespace std; #define in…
最小生成树模板题 注意最后输出用%f (从C99开始%f已经不能用于输出double 即 输入用%lf 输出用%f) #include<cstdio> #include<algorithm> #include<cmath> #include<cstring> #include<string> #define M(a,b) memset(a,b,sizeof(a)) #define debug(x) cerr<<#x<<&q…
最小生成树,用了Kruskal算法.POJ上C++能过,G++不能过... 算出每两个圆心之间的距离,如果距离小于两半径之和,那么这两个圆心之间的距离直接等于0,否则等于距离-R[i]-R[j]. #include<stdio.h> #include<string.h> #include<math.h> #include<algorithm> using namespace std; ; struct abc{ int start, end; double…
题目链接 http://poj.org/problem?id=2031 题意 给出N个球形的 个体 如果 两个个体 相互接触 或者 包含 那么 这两个个体之间就能够互相通达 现在给出若干个这样的个体 要求 从一个个体 可以到达任意一个另外的个体 如果两个个体之间 本来是不能够相互通达的 那么可以在这两个个体之间 建一座桥梁 现在要求 满足 从任意一个个体就可以到达任意一个另外的个体 需要建设桥梁的最少花费 思路 因为两个球体之间,如果 两个球心的距离 <= 两个球体的半径之和 那么这两个球体 就…
这个题要交c++, 因为prime的返回值错了,改了一会 题目:http://poj.org/problem?id=2031 题意:就是给出三维坐标系上的一些球的球心坐标和其半径,搭建通路,使得他们能够相互连通.如果两个球有重叠的部分则算为已连通,无需再搭桥.求搭建通路的最小费用(费用就是边权,就是两个球面之间的距离 思路:求球之间的距离, 距离小于半径 说明联通 , 距离为0. #include<iostream> #include<cstdio> #include<cst…
题目传送门 题意:给出n个三维空间的球体,球体是以圆心坐标+半径来表示的,要求在球面上建桥使所有的球联通,求联通所建桥的最小长度. 分析:若两点距离大于两半径和的长度,那么距离就是两点距离 - 半径和,否则为0,Prim写错了,算法没有完全理解 /************************************************ * Author :Running_Time * Created Time :2015/10/25 12:00:48 * File Name :POJ_2…
Building a Space Station POJ - 2031 You are a member of the space station engineering team, and are assigned a task in the construction process of the station. You are expected to write a computer program to complete the task. The space station is ma…
Building a Space Station Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 8572   Accepted: 4093 Description You are a member of the space station engineering team, and are assigned a task in the construction process of the station. You ar…
Building a Space Station Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 7469   Accepted: 3620 Description You are a member of the space station engineering team, and are assigned a task in the construction process of the station. You ar…
http://poj.org/problem?id=2031 Description You are a member of the space station engineering team, and are assigned a task in the construction process of the station. You are expected to write a computer program to complete the task.  The space stati…
链接: http://poj.org/problem?id=2031 Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 6011   Accepted: 2989 Description You are a member of the space station engineering team, and are assigned a task in the construction process of the stati…
http://poj.org/problem?id=2031 Description You are a member of the space station engineering team, and are assigned a task in the construction process of the station. You are expected to write a computer program to complete the task. The space statio…
You are a member of the space station engineering team, and are assigned a task in the construction process of the station. You are expected to write a computer program to complete the task. The space station is made up with a number of units, called…
Problem Description You are a member of the space station engineering team, and are assigned a task in the construction process of the station. You are expected to write a computer program to complete the task. The space station is made up with a num…
Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 3820   Accepted: 1950 Description You are a member of the space station engineering team, and are assigned a task in the construction process of the station. You are expected to write a com…