摘要:
因为每一幢楼都有线连,选择最小与外界供电设施所需要的费用最小的楼做外连。这个楼也是做为其他楼的根节点。 #include#includeusing namespace std;#define M 125000int u[M],v[M],w[M],r[M],p[502];int cmp(const int i,const int j)//间接排序{ return w[i] < w[j]; }int find(int x){ return p[x] == x ? x : p[x]=find(p[x]); }int main(){ int i,m,k,x,y,ans,t,n,e; //f... 阅读全文