题目网址:http://poj.org/problem?id=3268 题意:有N只牛,编号从1到N他们从自己的地方到X去开会然后再回来,他们都选择最短的路径,问从去到回来,每只牛走的最远距离是多少? 方法:先求从X到各个点的最短路,然后把路径交换一下,再求一次从x到各点的最短路 ...
分类:
其他好文 时间:
2016-08-22 10:36:24
阅读次数:
190
Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 18713 Accepted: 8561 Description One cow from each of N farms (1 ≤ N ≤ 1000) conveniently n ...
分类:
其他好文 时间:
2016-08-16 00:04:20
阅读次数:
147
DescriptionOne cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A total of M (1 ≤ M ≤ 100,000) unidirectional (...
分类:
其他好文 时间:
2016-08-10 14:25:32
阅读次数:
177
POJ 3268 Silver Cow Party spfa。。 闲来无事水一发奶牛题睡觉好了。。马上就11好了【泪流满面 Description:n个点(1 <= n <= 1000),m条带权值(花费)有向边(1 <= m <= 1e5),给定一个目标点T,求点的价值最大值。 我们给每一个点的价 ...
分类:
其他好文 时间:
2016-08-07 00:57:03
阅读次数:
200
本题链接 : http://poj.org/problem?id=3268 题目大意:牛们要去聚会,输入N = 顶点数(牛场);M = 边(路)的数目; X = 终点 (聚会点)。问题:求来回时间的最大值。 Input: Line 1: Three space-separated integers, ...
分类:
其他好文 时间:
2016-07-28 15:47:10
阅读次数:
177
迪杰斯特拉,算法,题意理解了就好了:N个农场的牛去 K 农场打牌,打完牌再从K农场回到各自的农场,问一来一回过程中走路最长的牛(牛选择最短路走)。然后一个正的最短路,一个反的最短路 就ok了。 ...
分类:
其他好文 时间:
2016-07-12 22:59:08
阅读次数:
148
题目链接:http://poj.org/problem?id=3268 Description One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow ...
分类:
其他好文 时间:
2016-06-15 22:16:56
阅读次数:
274
( ̄▽ ̄)" #include #include #include #include #include using namespace std; const int INF=10e8; const int MAXN=1010; int k,minn; int cost[MAXN][MAXN],low...
分类:
其他好文 时间:
2016-02-18 01:15:48
阅读次数:
207
题目传送门 1 2题意:有向图,所有点先走到x点,在从x点返回,问其中最大的某点最短路程分析:对图正反都跑一次最短路,开两个数组记录x到其余点的距离,这样就能求出来的最短路以及回去的最短路.POJ 3268//#include #include #include #include #include ...
分类:
其他好文 时间:
2015-11-27 21:55:04
阅读次数:
253