![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
并查集
李总LKC
这个作者很懒,什么都没留下…
展开
-
POJ 1733 parity game (hash离散+并查集)
#include using namespace std; #define N 5005 /* hash+离散化=================================================================================== */ struct node { int val; int next; }E[N]; int v[N], cnt=原创 2014-03-24 04:03:22 · 680 阅读 · 0 评论 -
HDU 3038 how many answers are wrong(带权并查集)
很简单的题,找出各个节点与根节点的关系,并与输入的权值进行比较 #include using namespace std; #define MAX 200005 struct num { int father; int relationship; }num[MAX]; void make_set(int N) { for(int i=0;i<=N;i++) { num[i].fa原创 2014-03-24 04:39:44 · 481 阅读 · 0 评论