码迷,mamicode.com
首页 >  
搜索关键字:spfa    ( 1879个结果
Spfa算法
Invitation CardsTime Limit: 8000MSMemory Limit: 262144KTotal Submissions: 22277Accepted: 7298DescriptionIn the age of television, not many people atte...
分类:编程语言   时间:2015-08-20 12:57:43    阅读次数:119
hdu 2680 Choose the best route (SPFA算法)
本题链接:点击打开链接 本题大意:         输入n,m,s,代表有n个点,m条边,s代表终点。然后输入边,每条边输入p,q,t;p,q代表两个点,t表示边权,注意题目中说是从p指向q边,故应建立有向图。然后输入w表示有w个起点,然后输入起点;对于多个起点,如果对每个起点使用一次SPFA,则起点多的话可能会有点麻烦,所以不妨这样进行处理:另外设置一个不与题目中重合的点,将所有起点到此点的...
分类:编程语言   时间:2015-08-20 10:42:32    阅读次数:142
HDU 2112 HDU Today <SPFA算法+map函数>
HDU Today Time Limit: 15000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 19826    Accepted Submission(s): 4671 Problem Description 经过锦囊相助,海东集团终于度过了...
分类:编程语言   时间:2015-08-20 10:31:09    阅读次数:106
poj 1847 Tram【spfa最短路】
TramTime Limit:1000MSMemory Limit:30000KTotal Submissions:12005Accepted:4365DescriptionTram network in Zagreb consists of a number of intersections an...
分类:其他好文   时间:2015-08-19 19:43:26    阅读次数:95
UVA10557- XYZZY(spfa+设置次数上限)
题意:有N个房间,刚开始你位于1号房间,有100的能量值,你要到达N号房间,每两个房间之间有单向门相连接,你到达某个房间可以加上该房间的能量值,如果你在未到达N号房间之前能量值耗尽,则死亡,否则胜利。解析:spfa,设power[]是从1到达某个点的能量值,如果power[v]>power[u]+e...
分类:其他好文   时间:2015-08-19 16:32:57    阅读次数:127
hdu1142(spfa+DFS记忆化)
这道题因为英语渣半天没看懂题意,后来在网上找了一些题解发现,好多人题意理解错了,但是代码交上去能过。最后终于找到了一个能说明白的题解。链接:http://www.cnblogs.com/ruihua852/archive/2012/08/27/2658910.html下面是粘贴的链接中的题意:题目意...
分类:其他好文   时间:2015-08-19 16:20:12    阅读次数:149
poj 3259 Wormholes【spfa判断负环】
WormholesTime Limit:2000MSMemory Limit:65536KTotal Submissions:36729Accepted:13444DescriptionWhile exploring his many farms, Farmer John has discovere...
分类:其他好文   时间:2015-08-19 13:16:40    阅读次数:133
SPFA,dijskra,prime,topu四种算法的模板
1 ////#include 2 ////#include 3 ////#include 4 ////#include 5 ////using namespace std; 6 ////const int INF=0x3f3f3f3f; 7 ////const int MAXN=11...
分类:编程语言   时间:2015-08-19 12:48:09    阅读次数:249
POJ 3259 Wormholes(spfa判负环)
WormholesDescriptionWhile exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it i...
分类:其他好文   时间:2015-08-19 12:39:37    阅读次数:99
bzoj 2763
好几天没怎么发了。。。最近去看了下初赛题。。。水题,最短路还有免费(我怎么没有!!),分几次免费乱搞一下就可以。。不过路径权值居然还有0,就WA了一下。。。写spfa的习惯得改改。。。 1 #include 2 #define inc(i,l,r) for(i=l;i=r;i--) 4 #defin...
分类:其他好文   时间:2015-08-19 00:21:59    阅读次数:107
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!