
并查集
高自期许
欢迎大家找我交流
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
POJ 1192 食物链(并查集)
食物链Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 111364 Accepted: 33824Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。有人用两种...原创 2019-12-11 13:43:43 · 207 阅读 · 0 评论 -
AizuOJ DSL_1_A Disjoint Set: Union Find Tree(并查集)
题目链接:http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_1_Asolution:经典并查集#include <bits/stdc++.h>using namespace std;int arr[10000];int find(int x){ while (arr[x] != x)x = ar...原创 2019-09-26 09:15:00 · 154 阅读 · 0 评论 -
AizuOJ DSL_1_B Weighted Union Find Trees(加权并查集)
题目链接:http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_1_Bsolution:#include <bits/stdc++.h>using namespace std;int arr[100000], value[100000];int find(int x){ if (arr[x] == x...原创 2019-09-26 12:41:34 · 307 阅读 · 0 评论 -
AizuOJ 2170 Marked Ancestor(并查集)
Marked AncestorTime Limit : 8 sec, Memory Limit : 131072 KBEnglishProblem F: Marked AncestorYou are given a tree T that consists of N nodes. Each node is numbered from 1 to N, and node 1 is always...原创 2019-10-07 14:10:23 · 216 阅读 · 0 评论 -
AizuOJ 1330 Never Wait for Weights(带权并查集)
Never Wait for WeightsTime Limit : 8 sec, Memory Limit : 131072 KBEnglishProblem F: Never Wait for WeightsIn a laboratory, an assistant, Nathan Wada, is measuring weight differences between sample...原创 2019-10-07 15:55:56 · 161 阅读 · 0 评论