题目链接:http://poj.org/problem?id=3268
所有的牛去一个牛的家里参加聚会,所给的路径是单向的,问往返的所有牛的路径长度中最长的是多少?
解法:往返时候翻转矩阵,再求一遍最短路径,两次相加后进行比较。
#include
#include
#include
#include
#include
using namespace std;
const...
分类:
其他好文 时间:
2015-01-29 09:31:14
阅读次数:
129
题目链接:http://poj.org/problem?id=1797
求路径中承载量的最小值
#include
#include
#include
#include
#include
using namespace std;
const int MAXV = 4010;
const int inf = 10000000;
int map[MAXV][MAXV];
int d[...
分类:
其他好文 时间:
2015-01-28 17:59:22
阅读次数:
178
题目链接:http://poj.org/problem?id=2253
求最短路径中的最长边,修改的 d [MAXN]; 的意义即可...
分类:
其他好文 时间:
2015-01-28 16:05:24
阅读次数:
214
dij 模板
通过 poj 2387 求去点1 -点 n 的最短路径
#include
#include
#include
#include
#include
using namespace std;
const int MAXV = 4010;
const int inf = 10000000;
int map[MAXV][MAXV];//路径长度
int d[MAXV];/...
分类:
其他好文 时间:
2015-01-28 14:44:15
阅读次数:
169
http://poj.org/problem?id=1789
题意理解就是裸的MST
#include
#include
#include
#define INF 0x3f3f3f3f
using namespace std;
char str[2010][10];
int dis[2010],edge[2010][2010];
bool vis[2010];
int m,ans;
in...
分类:
其他好文 时间:
2015-01-28 09:58:08
阅读次数:
169
http://poj.org/problem?id=1751
最小生成树简单应用
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define INF 10000000
double map[1110][1110],dis[1110];
int n,m,v...
分类:
其他好文 时间:
2015-01-27 18:32:22
阅读次数:
176
题目链接:点击打开链接
又是一发 G++ WA , C++ AC.
简单题:给出基站的三围坐标及半径 。若球面距离小于 0 距离为 0 ,否则为 圆心距离减去2个半径
#include
#include
#include
#include
#include
#define INF 10000000
using namespace std;
double map[110]...
分类:
其他好文 时间:
2015-01-27 16:33:31
阅读次数:
120
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1586
简单题
Sunny Cup 2003 - Preliminary Round
April 20th, 12:00 - 17:00
Problem E: QS Network
In the planet w-503 of galaxy cgb, t...
分类:
Web程序 时间:
2015-01-27 16:32:02
阅读次数:
219