
----------数据结构----------
hanker99
这个作者很懒,什么都没留下…
展开
-
HDU 1213并查集入门题
#include<cstdio>#include<cstring>using namespace std;const int maxn=1000+5;int pa[maxn];void init(int n){ for(int i=0;i<=n;i++) pa[i]=i;}int findset(int x){ ...原创 2019-02-28 15:41:18 · 149 阅读 · 0 评论 -
CF 1092E - Minimal Diameter Forest 构造算法,贪心,树,搜索
You are given a forest — an undirected graph withnnvertices such that each its connected component is a tree.The diameter (aka "longest shortest path") of a connected undirected graph is the maxim...原创 2019-05-07 19:30:41 · 381 阅读 · 0 评论