![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
----------图论----------
文章平均质量分 50
xmzyt1996
这个作者很懒,什么都没留下…
展开
-
POJ 1258 Agri-Net //Prim算法
题目描述POJ1258解题思路给出村庄的邻接矩阵,求其MST. Prim算法的模板题.参考代码#include <iostream>#include <cstdio>#include <algorithm>#include <vector>#include <cstring>#define inf 0x3f3f3f3f#define MAX_V 110using namespace原创 2015-07-15 20:50:45 · 346 阅读 · 0 评论 -
POJ 3615 Cow Hurdles //Floyd算法
题目描述POJ3615 Cow Hurdles解题思路核心代码: f[i][j] = min(f[i][j],max(f[i][k],f[k][j]));参考代码#include <iostream>#include <algorithm>#include <cstdio>#include <cstring>#define inf 0x3f3f3f3f#define MAX_V 310u原创 2015-07-15 21:03:48 · 295 阅读 · 0 评论 -
POJ 1861 Network //Kruscal算法
题目描述POJ1861 Network解题思路题目大意: 给出顶点数,边数,再输入若干条边,求出若干条边满足条件: 1)这几条边中长度最大的长度尽量小; 2)这若干条边可保证图的连通性; 3)在1,2的基础上,求个MST Kruscal算法求出的生成树满足一个特性:这个生成树的最长边是尽量短的.参考代码#include <iostream>#include <algorithm>#in原创 2015-07-15 20:40:54 · 290 阅读 · 0 评论 -
POJ 1125 Stockbroker Grapevine //Floyd算法
题目描述POJ1125 Stockbroker Grapevine解题思路找出一个人,使谣言从其传出到所有人用时最短. (1):用Floyd先算出某人到每个人的最短时间,再对时间取最大 (保证每个人都能收到谣言…) = =| (2):对每个人执行(1),取时间最小,即为所求.参考代码#include <iostream>#include <algorithm>#include <cstdio原创 2015-07-15 21:00:22 · 288 阅读 · 0 评论 -
UVALive 6432 Influence // 暴力dfs
Problem Description In any society there are social influence relations between individuals, where a person x can influence another person y. The same is true for Softopia, a special society where so原创 2015-10-02 23:30:06 · 378 阅读 · 0 评论