poj-1703-Find them, Catch them】的更多相关文章

POJ 2236 Wireless Network http://poj.org/problem?id=2236 题目大意: 给你N台损坏的电脑坐标,这些电脑只能与不超过距离d的电脑通信,但如果x和y均能C通信,则x和y可以通信.现在给出若干个操作, O p 代表修复编号为p的电脑 S p q代表询问p和q是不是能通信. 思路: 并查集即可.. 如果修复了一台电脑,则把与它相连距离不超过d的且修复了的放在一个集合里面. #include<cstdio> #include<cstring&…
Find them, Catch them Time Limit:1000MS     Memory Limit:10000KB     64bit IO Format:%I64d & %I64u Submit Status Practice POJ 1703 Description The police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs…
Find them, Catch them Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 41463   Accepted: 12753 Description The police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs in the city, Gang Drago…
Find them, Catch them Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 43132   Accepted: 13257 Description The police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs in the city, Gang Drago…
http://acm.hdu.edu.cn/showproblem.php?pid=1829 http://poj.org/problem?id=2492 臭虫有两种性别,并且只有异性相吸,给定n条臭虫(编号1-n)和m对关系,判断是否是出现同性恋的情况. 这题跟食物链的题类似,这里只有两种关系,关系是同性或者异性. 对于每只动物创建两个元素  同性或异性,并用这 2×n个元素建立并查集. 首先判断输入的x和y是否是一个组的.是就flag=1. 然后,如果x和y是一对,那么合并x和y+n,x+n…
题目:http://poj.org/problem?id=1703 题意:一个地方有两个帮派, 每个罪犯只属于其中一个帮派,D 后输入的是两个人属于不同的帮派, A后询问 两个人是否属于 同一个帮派. 用op[]数组记录 不跟自己在一个帮派中的一个人, 然后再输入不跟自己在一个帮派的人的时候,把 这个人跟 op[]数组记录里的那个人联系起来, 这两个人属于一个帮派. #include <iostream> #include <cstdio> #include <cstring…
Find them, Catch them Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 31102   Accepted: 9583 Description The police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs in the city, Gang Dragon…
Find them, Catch them Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 52925   Accepted: 16209 Description The police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs in the city, Gang Drago…
题目地址:http://poj.org/problem?id=1703 Sample Input 1 5 5 A 1 2 D 1 2 A 1 2 D 2 4 A 1 4 Sample Output Not sure yet. In different gangs. In the same gang. 题目解读:T组数据,每组输入n m,n代表有n个人, m代表有m次操作.操作A x y:表示询问x y的关系是怎样的? 三中情况:不确定,属于同一个集合, 不属于同一个集合操作D x y:表示x y…
Find them, Catch them Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 36176   Accepted: 11090 Description The police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs in the city, Gang Drago…