写了7000b代码 真是醉了#include #include #include #include #include #include #include #include #include #include
cal;int ecnt;void bug();struct Edge{ int u,v; LL w; Edge(int u=0,int v=0,LL w=0):u(u),v(v),w(w){} bool operator<(const Edge& rhs)const{ if(u!=rhs.u)return u
v)swap(u,v); E[i].u=u;E[i].v=v;E[i].w=w; //addedge(u,v,w); //addedge(v,u,w); } sort(E,E+m); ecnt=0; for(int i=1;i mid){ isweight[i]=1; cal.PB(i); }else{ isweight[i]=0; } } fab(u,1,n){ if(isweight[u]){ for(int p=head[u];~p;p=next[p]){ int v=to[p]; if(isweight[v]&&v