摘要: 题目描述: 传送门 题解思路:很明显总道路数应该是村子数-1 只需要判断有多少条重复的道路即可 结果即为(n-1-(m-重复数)) 代码: #include<iostream> #include<cstdio> using namespace std; const int maxn=1000+10; 阅读全文
posted @ 2020-10-10 20:36 neverstopcoding 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 题目: 传送门 题解:纯并查集模板题 代码: #include<iostream> using namespace std; int n,m; //n为结点数量 const int maxn=1e4+10; int par[maxn]; //储存祖先结点 int rank1[maxn]; //储存结 阅读全文
posted @ 2020-10-10 19:45 neverstopcoding 阅读(124) 评论(0) 推荐(0) 编辑