Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

用prim过了,不知道dijkstra怎么修改。

Posted by 201030720525 at 2011-04-05 01:32:12 on Problem 2253
求出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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator