摘要:
利用并查集求最短路,注意浮点数,再就是需要准备一下边集。#include<stdio.h>#include<math.h>#include<stdlib.h>#define MAXN 5000 + 100#define MAXN1 100 + 10int n, m, p1, p[MAXN1],r[MAXN],u[MAXN],v[MAXN];double w[MAXN], x[MAXN1], y[MAXN1];int cmp(const void *_p, const void *_q){ int *p = (int *)_p; int *q = (int * 阅读全文