主站
DreamJudge
院校信息
专业题库
模拟考试
机试真题
专业课程
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
阿离
2024年3月18日 18:34
还是畅通工程 题解:
P1341
回复 0
|
赞 0
|
浏览 131
#include <bits/stdc++.h> using namespace std; const int maxn=105; int fa[maxn]; struct node{ int n1,n2,km; }edge[maxn*maxn]; int cmp(node a,node b){ return a.km<b.km; } int find(int x){ if(x==fa[x]) return x; &nbs...
1935569240
2024年3月12日 10:40
还是畅通工程 题解:简单的
P1341
回复 0
|
赞 0
|
浏览 175
#include<iostream> #include<algorithm> #include<string> #include<string.h> using namespace std; //定义结点之间的连接信息 struct node { int x; int y; int fee; }; int fa[100];//记录结点的自己的父亲 int sum = 0,ans=0, n;//记录总建路数 struct no...
不知道谁
2023年1月16日 14:43
kruskal(并查集板子题)
P1341
回复 0
|
赞 1
|
浏览 3.1k
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 10, M = 2e5 + 10, INF = 0x3f3f3f3f; int n, m; int p[N]; struct Edge { int a, b, w; bool operator<(const Edge &e) const { return w < e.w; } } es[M]; int find(int x) { ...
James
2021年2月18日 19:37
克鲁斯卡尔
P1341
回复 0
|
赞 0
|
浏览 6.6k
#include <iostream> #include <algorithm> using namespace std; const int maxn=1e3; int f[maxn]; struct node{ int x,y,w; }; void init(int n){ for(int i=0;i<=n;i++){ f[i]=i;  ...
题目
还是畅通工程
题解数量
4
发布题解
热门题解
1
kruskal(并查集板子题)
2
还是畅通工程 题解:简单的
3
还是畅通工程 题解:
4
克鲁斯卡尔