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 |
注意边界比较,i==m时要判断我的程序的主要部分: int Kruskal(){ int i,k,max=0; init_set(); for(i=1,k=0;i<=m;i++) if(find_father(edge[i].u)!=find_father(edge[i].v)){ union_set(edge[i].u,edge[i].v); k++; if(max<edge[i].w) max=edge[i].w; if(k==n-1) return max; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator