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 |
用prim过了,不知道dijkstra怎么修改。求出MST后,只需要找1到2的边上权值最大的即可。 伪代码 //closed[i]=j 表示点i依附点j的边权值最少 int index=2; double ans=0; while(index!=1) { ans=max(ans,lowcost[index]); index=closed[index]; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator