
图论-最小生成树
___Evan
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
poj-3723 Conscription 最大生成树
#include #include #include #include #include using namespace std; typedef long long LL; const int maxn = 20005; const int Mod = 1000000007; int n,m,R,ans; int p[maxn]; struct node { int x,y,w; }原创 2014-07-31 20:02:10 · 424 阅读 · 0 评论 -
POJ-2728 Desert King 01参数规划-最优比率生成树
#include "stdio.h" #include "queue" #include "iostream" #include "functional" #include "math.h" #include "algorithm" using namespace std; const int maxn = 1005; const int mod = 1000000007 ; const int原创 2014-07-29 11:08:34 · 489 阅读 · 0 评论 -
poj-3625 Building Roads kruskal
#include #include #include #include #include using namespace std; typedef long long LL; const int maxn = 1005; const int Mod = 1000000007; const int inf = 1<<30; int n,m,Max; int p[maxn]; bool vi原创 2014-07-27 14:51:56 · 622 阅读 · 1 评论 -
poj-3625 Building Roads
题目链接原创 2014-07-27 14:48:17 · 439 阅读 · 0 评论 -
poj-2349 Arctic Network 最小生成树
#include #include #include #include #include using namespace std; typedef long long LL; const int maxn = 1005; const int Mod = 1000000007; int s,n,m,c; double ans; struct Node { int x,y; }point[原创 2014-07-27 15:01:31 · 416 阅读 · 0 评论 -
poj-1789 Truck History 最小生成树
#include #include #include #include #include using namespace std; typedef long long LL; const int maxn = 2005; const int Mod = 1000000007; const int inf = 1<<30; int n; char str[maxn][10]; bool v原创 2014-07-27 15:01:03 · 381 阅读 · 0 评论 -
poj-1287 Networking 最小生成树
#include #include #include #include #include using namespace std; typedef long long LL; const int maxn = 55; const int Mod = 1000000007; int n,m,ans; struct node { int u,v,w; }edge[maxn*maxn]; i原创 2014-07-27 14:57:57 · 407 阅读 · 0 评论 -
poj-1751 Highways 最小生成树
题目链接原创 2014-07-27 14:40:07 · 407 阅读 · 0 评论 -
poj-1679 The Unique MST 判断最小生成树是否唯一
#include "stdio.h" #include "string.h" #include "queue" #include "iostream" #include "functional" #include "math.h" #include "algorithm" using namespace std; const int maxn = 105; const int mod = 1000原创 2014-07-27 14:45:09 · 432 阅读 · 0 评论 -
Uva 10369 Arctic Network 最小生成树
#include #include #include #include #include using namespace std; typedef long long LL; const int maxn = 1005; const int Mod = 1000000007; int s,n,m,c; double ans; struct Node { int x,y; }point[原创 2014-07-16 13:57:41 · 399 阅读 · 0 评论 -
POJ-1789 Truck History 裸最小生成树
#include #include #include #include #include #include #include #include using namespace std; const int maxn = 2005; const int inf = 1<<30; int n; int map[maxn][maxn],dis[maxn]; bool vis[maxn]; string原创 2014-01-24 15:14:53 · 428 阅读 · 0 评论 -
HDU-1233 还是畅通工程 并查集加Kruskal
#include #include #include using namespace std; int n,ans; int p[105]; struct node { int s,e,dis; }road[5000]; bool cmp( node a,node b) { return a.dis<b.dis; } int find(int x) { return x!=p[x]原创 2013-11-04 22:48:37 · 595 阅读 · 0 评论 -
HDU-1879 继续畅通工程 prime
#include "stdio.h" #include "string.h" const int maxn = 105; const int inf = 1<<30; int n; int map[maxn][maxn],dis[maxn]; bool vis[maxn]; int prime() { int i,j,min,pos,ans = 0; //起点 答案 vis[1原创 2013-11-04 21:23:02 · 601 阅读 · 0 评论 -
HDU-1233 还是畅通工程 最小生成树Prime
#include #include #include #include #include using namespace std; const int maxn = 105; const double inf = 100000000.0; int n,m; double dis[maxn]; bool vis[maxn]; struct Node { int x,y; }node[maxn];原创 2013-11-04 22:44:31 · 604 阅读 · 0 评论 -
hdu-3938 Portal 离线最小生成树
#include #include #include #include #include #include #include using namespace std; typedef __int64 LL; const int maxn = 50005; const int inf = 2000000001; int n,m,q; int p[maxn],r[maxn]; struc原创 2014-09-03 09:05:51 · 573 阅读 · 0 评论