并查集
cwqHHH
这个作者很懒,什么都没留下…
展开
-
【并查集复习】hrbust oj 1073/1173/1490/1725/1160
1073#include <iostream>#include <stdio.h>#include <algorithm>using namespace std;int pre[50005];void init(int n){ for(int i=0; i<n; i++) pre[i] = i;}int Find(int x){ if(pre[x] != x) return pre[x] = Find(pre[原创 2020-06-17 23:09:11 · 189 阅读 · 1 评论 -
并查集 hrbust 1725
Virus OutbreakingTime Limit: 1000 MSMemory Limit: 32768 KTotal Submit: 120(35 users)Total Accepted: 43(32 users)Rating: Special Judge: NoDescription原创 2017-11-30 10:22:36 · 201 阅读 · 0 评论 -
并查集 hrbust1160
吸血鬼Time Limit: 1000 MSMemory Limit: 65536 KTotal Submit: 456(210 users)Total Accepted: 260(203 users)Rating: Special Judge: NoDescription R原创 2017-11-28 10:45:34 · 163 阅读 · 0 评论 -
并查集 hdu How Many Tables
Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the friends know each other, a原创 2017-11-27 23:27:03 · 136 阅读 · 0 评论 -
并查集 HDU小希的迷宫
上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希望任意两个房间有且仅有一条路径可以相通(除非走了回头路)。小希现在把她的设计图给你,让你帮忙判断她的原创 2017-11-28 00:13:28 · 149 阅读 · 0 评论