|
|
@ -56,6 +56,9 @@ bool st[N];
|
|
|
|
int res;
|
|
|
|
int res;
|
|
|
|
|
|
|
|
|
|
|
|
int prim() {
|
|
|
|
int prim() {
|
|
|
|
|
|
|
|
memset(dis, 0x3f, sizeof dis);
|
|
|
|
|
|
|
|
dis[1] = 0;
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < n; i++) { // 迭代n次
|
|
|
|
for (int i = 0; i < n; i++) { // 迭代n次
|
|
|
|
int t = -1;
|
|
|
|
int t = -1;
|
|
|
|
for (int j = 1; j <= n; j++)
|
|
|
|
for (int j = 1; j <= n; j++)
|
|
|
@ -75,7 +78,6 @@ int main() {
|
|
|
|
cin >> n;
|
|
|
|
cin >> n;
|
|
|
|
// 初始化
|
|
|
|
// 初始化
|
|
|
|
memset(g, 0x3f, sizeof g);
|
|
|
|
memset(g, 0x3f, sizeof g);
|
|
|
|
memset(dis, 0x3f, sizeof dis);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 1; i <= n; i++)
|
|
|
|
for (int i = 1; i <= n; i++)
|
|
|
|
for (int j = 1; j <= n; j++)
|
|
|
|
for (int j = 1; j <= n; j++)
|
|
|
|