Wireless Network--poj2236(并查集)】的更多相关文章

Wireless Network Time Limit: 10000MS   Memory Limit: 65536K Total Submissions: 39772   Accepted: 16479 题目链接:http://poj.org/problem?id=2236 Description: An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a…
题目地址:http://poj.org/problem?id=2236 题目大意:n台电脑都坏了,只有距离小于d且被修好的电脑才可以互相联系,联系可传递.输入n和d,n个点的坐标x y.两个操作:O x表示把电脑x修好了,S x y表示询问x和y能否联系. 思路:并查集把能互相联系的电脑都放到同一个集合里(联系可以互相传递),查询的时候只要看x和y是否在一个集合就行了. 另设置两个数组visit[x]表示x是否被修好,dis[x][y]表示x和y之间的距离是否符合要求[先预处理任意两个点之间的距…
Wireless Network 这接翻译了 Descriptions 地震发生在东南亚.ACM(亚洲合作医疗团队)已经与膝上电脑建立了无线网络,但是一次意外的余震袭击,网络中的所有计算机都被打破了.计算机一个接一个地修复,网络逐渐开始工作.由于硬件限制,每台计算机只能直接与距离它不远的计算机进行通信.但是,每台计算机都可以被视为两台其他计算机之间通信的中介,也就是说,如果计算机A和计算机B可以直接通信,或者计算机C可以与A和A进行通信,则计算机A和计算机B可以进行通信. B. 在修复网络的过程…
传送门  Wireless Network Time Limit: 10000MS   Memory Limit: 65536K Total Submissions: 24513   Accepted: 10227 Description An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap co…
Wireless Network Time Limit: 10000MS   Memory Limit: 65536K Total Submissions: 16065   Accepted: 6778 Description An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computer…
Wireless Network 题目链接: http://acm.hust.edu.cn/vjudge/contest/123393#problem/A Description 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 aft…
Wireless Network Time Limit: 10000MS   Memory Limit: 65536K Total Submissions: 36363   Accepted: 15086 Description An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap compute…
Wireless Network Time Limit: 10000MS   Memory Limit: 65536K Total Submissions: 16832   Accepted: 7068 Description An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computer…
POJ - 2236 #include<iostream> #include<algorithm> #include<cstring> #include<cmath> using namespace std; int n,d; char c; int p,q; ]={},f[]; //分别是 标记是否修好 , 找爸 struct note { int x,y; }a[]; //记录坐标 int getf(int u) { return u==f[u]? u:…
Network Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 13172   Accepted: 4774 题目链接:http://poj.org/problem?id=3694 Description: A network administrator manages a large network. The network consists of N computers and M links between pair…