poj 1259 Agri-Net(最小生成树)】的更多相关文章

题目:http://poj.org/problem?id=1258 题意:模板题 和2485差不多 就是求相连后的最小值. #include <iostream> #include<cstdio> #include<cstring> #include<cstdlib> #include<stack> #include<queue> #include<cmath> #include<algorithm> usin…
链接: http://poj.org/problem?id=2485 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=22010#problem/H Highways Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 18668   Accepted: 8648 Description The island nation of Flatopia is perfect…
poj   1251  Jungle Roads  (最小生成树) Link: http://poj.org/problem?id=1251 Jungle Roads Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 23507   Accepted: 11012 Description The Head Elder of the tropical island of Lagrishan has a problem. A b…
Arctic Network Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Submit Status Practice POJ 2349 Appoint description:  System Crawler  (2015-06-01) Description The Department of National Defence (DND) wishes to connect seve…
Highways 题目链接: http://acm.hust.edu.cn/vjudge/contest/124434#problem/G Description The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has a very poor system of public highways. The Flatopian government is aware of this problem an…
有几个错误,调试了几个小时,样例过后 1Y. 题目:http://poj.org/problem?id=3026 题意:就是让求A们和S的最小生成树 先用bfs找每两点的距离,再建树.没剪枝 63MS. #include <iostream> #include<cstdio> #include<cstring> #include<cstdlib> #include<stack> #include<queue> #include<…
题目连接:problemId=542" target="_blank">ZOJ 1542 POJ 1861 Network 网络 Network Time Limit: 2 Seconds      Memory Limit: 65536 KB      Special Judge Andrew is working as system administrator and is planning to establish a new network in his com…
题链: http://poj.org/problem?id=1259 题解: 计算几何,凸包,DP 题意:给出N($N\leq100$)个点,求出最大的凸包使得凸包里面不存在点(边上可以有).输出最大凸包的面积. 把所有点按x从小到大排序(若x相同则按y从小到大排序). 依次枚举每个点p,把它作为凸包的左下角来计算此时可以形成的最大凸包. 做法如下: 将p号点作为原点,取出p+1~N的点(共m=N-p个点),对这m个点按极角逆时针排序. 然后定义DP状态: f[j][i]:表示以i,j作为当前凸…
poj 1251  && hdu 1301 Sample Input 9 //n 结点数A 2 B 12 I 25B 3 C 10 H 40 I 8C 2 D 18 G 55D 1 E 44E 2 F 60 G 38F 0G 1 H 35H 1 I 353A 2 B 10 C 40B 1 C 200Sample Output 21630 prim算法 # include <iostream> # include <cstdio> # include <cstr…
链接:poj 2485 题意:输入n个城镇相互之间的距离,输出将n个城镇连通费用最小的方案中修的最长的路的长度 这个也是最小生成树的题,仅仅只是要求的不是最小价值,而是最小生成树中的最大权值.仅仅须要加个推断 比較最小生成树每条边的大小即可 kruskal算法 #include<cstdio> #include<algorithm> using namespace std; int f[510],n,m; struct stu { int a,b,c; }t[20100]; int…