题解:先跑一遍最小生成树,然后再删除前k大的边,再输出最大的那条边。
#include#include #include #include using namespace std; int n,k; int a[100000],b[100000],f[100000]; struct s { int u,v; double w; }s1[10000000]; int getf(int u) { if(u==f[u]) return u; else { f[u]=getf(f[u]); return f[u]; } } int merge(int u,int v) { int t1=getf(u); int t2=getf(v); if(t1!=t2) { f[t2]=t1; return 1; } return 0; } bool cmp(s x,s y) { return x.w



