
并查集
zz09
这个作者很懒,什么都没留下…
展开
-
hdu 1879 继续畅通工程
........................................................................................................................................................................................................原创 2013-04-26 19:33:50 · 666 阅读 · 0 评论 -
poj 2524
并查集 水题#include#define MAX 100005int father[MAX];int count;int Find_Set(int x){ if(x!=father[x]) { father[x]=Find_Set(father[x]); } return father[x原创 2013-04-28 20:25:26 · 659 阅读 · 0 评论 -
poj 2492 A Bug's Life
#include#include #include#include#include#include#include#include#pragma comment(linker,"/STACK:102400000,102400000")using namespace std;#define MAX 10555int father[MAX];int ra原创 2013-04-29 21:21:40 · 705 阅读 · 0 评论 -
hdu 1856 More is better
More is betterProblem DescriptionMr Wang wants some boys to help him with a project. Because the project is rather complex, the more boys come, the better it will be. Of course there a原创 2013-04-30 20:59:58 · 698 阅读 · 0 评论 -
HDU 2122Ice_cream’s world III
Problem Descriptionice_cream’s world becomes stronger and stronger; every road is built as undirected. The queen enjoys traveling around her world; the queen’s requirement is like II problem, beau原创 2013-04-30 16:38:05 · 828 阅读 · 0 评论 -
hdu1272 小希的迷宫
上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希望任意两个房间有且仅有一条路径可以相通(除非走了回头路)。小希现在把她的设计图给你,让你帮忙判断她的原创 2013-04-30 20:57:29 · 736 阅读 · 0 评论 -
hdu 3371 Connect the Cities
........................................................................................................................................................................................只是最小生成树的变化,题意是原创 2013-05-01 16:41:25 · 668 阅读 · 0 评论 -
poj 1182 食物链
食物链Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。 有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法是"1 X Y",表示X和Y是同类。 第二种说法是"2 X Y",表示X吃Y。原创 2013-04-29 16:04:43 · 578 阅读 · 0 评论