#include<iostream> #include<cstdio> #include<algorithm> #include<cstdlib> #include<cmath> #include<cstring> using namespace std; struct edge { int u,v ...
分类:
其他好文 时间:
2017-07-15 15:55:45
阅读次数:
145
Out of Hay Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 11580 Accepted: 4515 Description The cows have run out of hay, a horrible event ...
分类:
其他好文 时间:
2017-04-24 14:37:41
阅读次数:
195
Out of HayTime Limit:1000MSMemory Limit:65536KTotal Submissions:13588Accepted:5259DescriptionThe cows have run out of hay, a horrible event that must ...
分类:
其他好文 时间:
2015-12-29 22:44:39
阅读次数:
298
题意就是给你一张无向连通图,试问对于图上所有点对(u,v)从u到v的所有路径中边权最大值的最小值的最大值。定义f(u,v)表示从u到v所有路径中边权最大值的最小值,对所有点对取其最大。实际上就是求图G的最小生成树的最大边权。考虑kruskal算法流程,每次选取边权最小的且不产生圈的边加入mst。至算...
分类:
其他好文 时间:
2015-09-28 16:10:46
阅读次数:
193
题意:最小生成树的最大边最小,sort从小到大即可poj2485#include#include#includeusing namespace std;#define maxn 505int map[maxn][maxn],pa[150000],num,n;struct node{ int x...
分类:
其他好文 时间:
2015-07-28 10:29:26
阅读次数:
126
题目大意:1号农场的草被牛吃完了,Bessie必须从其他农场运草回来,总共有N个农场,Bessie要
去其他所有的农场运草回来,他想要使总路程最短并且路线能连接所有的农场。必须要考虑到路上
带的水袋大小。因为水袋大小和路线中距离最长的两个农场之间的路有关,现在Bessie想要求出满
足要求的路线中两个农场之间最长的路距离是多少。
思路:满足要求的路线其实就是最小生成树,路线中两个农场之间最长的路距离就是最小生成树上
最长的边。这样用Kruskal求最小生成树的时候,用Max求出最小生成树上最长的边。...
分类:
其他好文 时间:
2015-01-24 21:28:01
阅读次数:
216
Out of Hay
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 11610
Accepted: 4535
Description
The cows have run out of hay, a horrible event that must be r...
分类:
其他好文 时间:
2014-12-08 12:26:26
阅读次数:
143
Out of Hay
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 11580
Accepted: 4515
Description
The cows have run out of hay, a horrible event that must be rem...
分类:
其他好文 时间:
2014-11-16 07:12:04
阅读次数:
164
点击打开链接
求MST的最长边~
prim
#include
#include
#include
#include
#define Min(a,b) (a)<(b)?(a):(b)
using namespace std;
const int INF = 1000000000;
const int maxn = 2000 + 5;
struct pto
{...
分类:
其他好文 时间:
2014-06-11 06:45:17
阅读次数:
235