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...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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator