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

我的bfs这样写的

Posted by 00448264 at 2005-05-18 17:46:15 on Problem 1724
In Reply To:我怎么就没爆掉? Posted by:TN at 2005-05-18 17:44:48
	while(H > 0)
	{
		RECORD p = h[1];
		int i;
		extract_min();//pop
		if(p.d < dist[p.s])
		{
			dist[p.s] = p.d;
		}
		for(i = intv[p.s].b; i < intv[p.s].e; i++)
		{
			int tw = p.w + road[i].w;
			if(tw <= W)
			{
				h[++H].s = road[i].t;
				h[H].d = p.d + road[i].l;
				h[H].w = tw;
				decrease_key(H);//push
			}
		}
	}

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