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...

Posted by litter at 2009-05-12 09:59:40 on Problem 2253
void prim()
{
    int i,j;
    for(i=1;i<n;i++)
    {
        if(visit[2]) break;
        else
        {
         double max=MAX;
         int k=1;
         for(j=2;j<=n;j++)
         if(visit[j]==0&&dis[j]<max) {max=dis[j];k=j;}
         visit[k]=1;   
         if(max>ans) ans=max; 
         for(j=2;j<=n;j++)
         if(visit[j]==0&&len(k,j)<dis[j])
         dis[j]=len(k,j);
        }
    }
    printf("Scenario #%d\n",cases);cases++;
    printf("Frog Distance = %.3lf\n\n",ans);
}

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