
并查集
Lngxling
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
CodeForces - 357C Knight Tournament ——并查集优化
C. Knight Tournament time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output Hooray! Berl II, the king of Berland i原创 2017-09-13 11:37:53 · 302 阅读 · 0 评论 -
UVA - 11987 Almost Union-Find ——删除元素的并查集
I hope you know the beautiful Union-Find structure. In this problem, you’re to implement something similar, but not identical. The data structure you need to write is also a collection of disjoint s原创 2017-09-11 23:10:59 · 267 阅读 · 0 评论 -
CodeForces - 505B Mr. Kitayuta's Colorful Graph —— 多维并查集
B. Mr. Kitayuta's Colorful Graph time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Mr. Kitayuta has just bough原创 2017-09-20 21:26:19 · 227 阅读 · 0 评论 -
HDU - 1213 How Many Tables ——并查集
How Many Tables Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 34088 Accepted Submission(s): 17022 Problem Description Today is原创 2017-09-12 21:54:19 · 207 阅读 · 0 评论 -
POJ - 1611 The Suspects ——并查集
The Suspects Time Limit: 1000MS Memory Limit: 20000K Total Submissions: 42212 Accepted: 20362 Description Severe acute respiratory syndrome (SARS), an atypical pneu原创 2017-09-12 21:09:24 · 242 阅读 · 0 评论 -
POJ - 2236 Wireless Network ——并查集
Wireless Network Time Limit: 10000MS Memory Limit: 65536K Total Submissions: 30641 Accepted: 12741 Description An earthquake takes place in Southeast Asia. The ACM原创 2017-09-11 23:41:46 · 204 阅读 · 0 评论 -
HDU - 3974 Assign the task —— 并查集
Assign the task Time Limit: 15000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3624 Accepted Submission(s): 1498 Problem Description There is原创 2017-09-19 23:02:04 · 344 阅读 · 0 评论 -
CodeForces - 371D Vessels——并查集
D. Vessels time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There is a system of n vessels arranged one abov原创 2017-09-11 17:26:34 · 420 阅读 · 0 评论 -
并查集
并查集—常用来解决有关求连通分支的问题 思想:用一个pre[n]数组将各个点联系起来 函数:find(int x) join(int x,int y) int find (int x)//递归定义 { return pre[x]==xx:pre[x]=find(pre[x]); } int find(int x)//通常定义 { int r=x; wh原创 2017-07-18 21:39:46 · 230 阅读 · 0 评论 -
二维并查集——CodeForces - 505B Mr. Kitayuta's Colorful Graph
原题链接CodeForces - 505B Mr. Kitayuta’s Colorful Graph 一个无向图包含n个点m条边,顶点编号从1到n。 对于每条边有颜色ci, 连接着顶点 ai 和 b i. 下面有q个询问.每条询问有两个整数 — ui 和 vi.找到满足下面条件的颜色个数: 同一种颜色的路径连接顶点 ui 和 顶点 vi Input 第一行是两个整数 — n an原创 2017-08-11 20:43:20 · 452 阅读 · 0 评论 -
poj1703 Find them, Catch them——带权并查集
Language:DefaultFind them, Catch themTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 47233Accepted: 14548DescriptionThe police office in Tadu City decides to say ends to the chaos, as launch a原创 2017-09-07 17:38:11 · 259 阅读 · 0 评论 -
poj 1182 食物链 —— 种类并查集
食物链 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 78828 Accepted: 23486 Description 动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动原创 2017-11-18 20:04:58 · 236 阅读 · 0 评论