并查集
RPG_Zero
春日雨,夏蝉鸣,明天是个好天气。
秋风起,雪花轻,海底看不见四季。
展开
-
POJ 2236 Wireless Network 并查集
题目链接 Wireless Network Time Limit: 10000MS Memory Limit: 65536K Description An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless netw...原创 2019-08-21 11:45:33 · 163 阅读 · 0 评论 -
poj1182食物链(并查集)
食物链 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 105281 Accepted: 31875 Description 动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。 有人用两...原创 2019-07-14 21:16:14 · 205 阅读 · 0 评论 -
POJ 1703 Find them, Catch them 种类并查集
题目链接 Find them, Catch them Time Limit: 1000MS Memory Limit: 10000K Description The police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs in...原创 2019-08-21 17:10:56 · 225 阅读 · 0 评论 -
AOJ 2170 Marked Ancestor 并查集 好题! 有助于理解路径压缩的意义
You are given a tree T that consists of N nodes. Each node is numbered from 1 to N, and node 1 is always the root node of T. Consider the following two operations on T: M v: (Mark) Mark node v. Q v: ...原创 2019-08-21 22:12:42 · 259 阅读 · 0 评论 -
九度 OJ1446 Head of a Gang PAT1034 并查集+map容器的使用
题目链接 One way that the police finds the head of a gang is to check people’s phone calls. If there is a phone call between A and B, we say that A and B is related. The weight of a relation is defined t...原创 2019-09-10 18:15:18 · 240 阅读 · 0 评论 -
Freckles 九度OJ 1144 POJ 2560 最小生成树模板题 Kruskal算法
题目链接 Description In an episode of the Dick Van Dyke show, little Richie connects the freckles on his Dad’s back to form a picture of the Liberty Bell. Alas, one of the freckles turns out to be a scar...原创 2019-09-10 21:04:55 · 215 阅读 · 0 评论