码迷,mamicode.com
首页 >  
搜索关键字:silver-cow    ( 95个结果
Poj 3268 Silver Cow Party
最短路水题,这次用SPFA写#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std...
分类:其他好文   时间:2014-07-18 21:02:55    阅读次数:207
POJ 3268 Silver Cow Party
求来回最短路加起来最长的一条。 两次SPFA,然后选某个点的来回最长。(有向图) Dijkstra+邻接矩阵 比较方便建立 反向图。 我用SPFA+2个邻接表(正图+反图),C++ 32ms。 #include #include #include #include #include #include #include #include #include #include #include ...
分类:其他好文   时间:2014-07-03 16:01:33    阅读次数:173
poj 3268 Silver Cow Party , spfa , dijkstra
点击打开链接 两次求最短路(第二次把边反向求) 1、spfa //poj 3268 Silver Cow Party //SPFA #include #include #include using namespace std; const int M = 100000 + 100; const int N = 1000 + 100; const int inf = 1...
分类:其他好文   时间:2014-06-08 05:29:39    阅读次数:241
POJ 3268 Silver Cow Party dijkstra单源最短路
裸dijkstra 思路:以x为源点,求到其他点的最短路,之后把邻接矩阵转置,再求一次x源 点的最短路,这样就一次是来的,一次是走的,相加迭代最大值即可 代码: /* poj 3268 8108K 47MS */ #include #include #define MAXN 1005 #define MAX_INT 2147483647 using namespace s...
分类:其他好文   时间:2014-06-04 23:32:57    阅读次数:303
POJ3268 Silver Cow Party
POJ3268...
分类:其他好文   时间:2014-05-02 20:41:57    阅读次数:271
95条   上一页 1 ... 8 9 10
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!