Find them, Catch them Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 38668 Accepted: 11905 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
Wireless Network Time Limit: 10000MS Memory Limit: 65536K Total Submissions: 25022 Accepted: 10399 Description An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap compute
Background Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and that they only interact with bugs of the opposite gender. In his experiment, individual bugs and their in
The Suspects Time Limit: 1000MS Memory Limit: 20000K Total Submissions: 35206 Accepted: 17097 Description Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. T
题意: 一次地震震坏了所有网点 现在开始修复它们 有N个点 距离为d的网点可以进行通信 O p 代表p点已经修复 S p q 代表询问p q之间是否能够通信 思路: 基础并查集 每次修复一个点重新刷一边图就行了 /* *********************************************** Author :Sun Yuefeng Created Time :2016/11/1 15:40:35 File Name :food.cpp ******************
题目链接:http://poj.org/problem?id=2492 题意是问是否存在同性恋, 就是a喜欢b,b喜欢c,a又喜欢c,所以就有同性恋了: #include<stdio.h> #include<string.h> #include<iostream> #include<algorithm> #define N 11000 using namespace std; int f[N], r[N]; int Find(int x) { int k=f
#include <cstdio> #define N 30010 int pa[N]; //parent int siz_tree[N]; //size of tree int d[N]; //dist between node and root int Find(int x) { if(pa[x] == x) return x; int t = pa[x]; pa[x] = Find(pa[x]); d[x] += d[t]; return pa[x]; } void Union(int
转自:http://blog.csdn.net/shahdza/article/details/7779230 [HDU]1213 How Many Tables 基础并查集★1272 小希的迷宫 基础并查集★1325&&poj1308 Is It A Tree? 基础并查集★1856 More is better 基础并查集★1102 Constructing Roads 基础最小生成树★1232 畅通工程 基础并查集★2120 Ice_cream's world I 基础并查集★212
http://acm.hdu.edu.cn/showproblem.php?pid=1829 A Bug's Life Time Limit:5000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1829 Description Background Professor Hopper is researching the sexual behavior of a