并查集
文章平均质量分 84
Black__wing
acm菜鸡
展开
-
poj 2236 并查集
A - Wireless Network An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers, but an unexpected aftershock attac原创 2018-01-30 21:53:01 · 188 阅读 · 0 评论 -
POJ 1611 并查集
Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best strategy is to s原创 2018-01-30 23:29:36 · 183 阅读 · 0 评论 -
hdu 1272 并查集
上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希望任意两个房间有且仅有一条路径可以相通(除非走了回头路)。小希现在把她的设计图给你,让你帮忙判断她的原创 2018-01-31 14:59:14 · 214 阅读 · 0 评论 -
2019沈阳网络赛B 并查集+dfs
补题的时候,忘记将怪兽节点的size值变为0。#include<bits/stdc++.h>using namespace std;int fa[200005],siz[200005];int getfa(int x){ int fx=fa[x]; if(fx!=x) { fa[x]=getfa(fx); } ret...原创 2019-09-18 19:03:47 · 232 阅读 · 0 评论