| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re: 你确实 SPFA 写错勒 附上 错误 部分代码In Reply To:Re:BellmanFord AC,SPFA为什么就WA呢?麻烦用SPFA过的同学给发份代码,或者给我看看,谢谢 Posted by:YA_ME_DE at 2009-05-06 13:55:56 while(!sqa.empty()){
int a=sqa.front();
sqa.pop();
vist[a]=false;
for(int i=1;i<=n;i++){
if(map[a][i].link==1&&result[i]+eps<(result[a]-map[a][i].com)*map[a][i].rate){
result[i]=(result[a]-map[a][i].com)*map[a][i].rate;
if(!vist[i]){
sqa.push(i);
vist[i]=true;
}
ok=true;
}
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator