摘要:
题解:最大生成树加判环……#include #include using namespace std;struct node{int a,b,l;}seg[100005];bool cmp(node a,node b){return a.l>b.l;}int ans,m,n,f[10005],mark[10005];int sf(int x){return f[x]==x?x:f[x]=sf(f[x]);}int main(){ while(scanf("%d%d",&n,&m)){ if (m==0&&n==0)break; ans= 阅读全文