码迷,mamicode.com
首页 >  
搜索关键字:并查集 hdu    ( 34854个结果
hdu 2066 一个人的旅行 解题报告
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2066题目意思:给出T条路,和草儿家相邻的城市编号,以及草儿想去的地方的编号。问从草儿家到达草儿想去的地方的最短时间是多少。 一开始自己写的只能处理单边出发的情况,对于以下这幅图,只能处理箭头所示的方向....
分类:其他好文   时间:2014-05-21 23:34:06    阅读次数:303
hdu 1856 More is better
题目:     链接:点击打开链接 题意:     给出n个直接认识的朋友,最大的直接或间接认识的朋友。 思路: 算法:     并查集,,, 代码: #include #include #include using namespace std; #define MAXN 100010 int root[MAXN]; int member[MAXN];//表示在i结点处的,认识的...
分类:其他好文   时间:2014-05-21 10:59:57    阅读次数:254
Is It A Tree?------HDOJ杭电1325(两种方法,可以用也可以不用并查集!!!!!!详解)
Problem Description A tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed edges between nodes satisfying the follow...
分类:其他好文   时间:2014-05-21 10:55:57    阅读次数:325
hdu 1171 Big Event in HDU 多重背包
Big Event in HDU Problem Description Nowadays, we all know that Computer College is the biggest department in HDU. But, maybe you don't know that Computer College had ever been split into Comp...
分类:其他好文   时间:2014-05-21 10:51:55    阅读次数:300
HDU 1429 胜利大逃亡(续)
请不要随便指点别人该怎么做、每个人的人生都应该自己掌握、你给不了别人一切、你也不懂别人的忧伤、                                                                                           微笑不代表快乐、哭泣不一定悲伤                不努力怎么让关心你的人幸福、不努力怎么让看不起你的...
分类:其他好文   时间:2014-05-21 10:31:31    阅读次数:202
hdu 1114 Piggy-Bank -- 完全背包
Piggy-Bank Problem Description Before ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound M...
分类:其他好文   时间:2014-05-21 10:17:35    阅读次数:289
HDU FATE (完全背包+有限取次)(二重费用背包)
FATE Problem Description 最近xhd正在玩一款叫做FATE的游戏,为了得到极品装备,xhd在不停的杀怪做任务。久而久之xhd开始对杀怪产...
分类:其他好文   时间:2014-05-21 10:16:18    阅读次数:194
poj1703 Find them,Catch them 【并查集】
做过一些的带权并查集,再来做所谓的“种类并查集",发现好像就顿悟了。 种类并查集与带权并查集实质上的差别并不大, 关键的区别就是种类并查集只是带权并查集再弄个%取余操作而已,然后余数就表示他属于哪个种类。 这题只有两个种类,也就是只有0和1两种, 对于两个不同的种类,那么之间的权值是相差1的,所以按照带权并查集的方法做加上1,然后取余2即可。 #include const int N = ...
分类:其他好文   时间:2014-05-21 07:24:40    阅读次数:173
[ACM] hdu 2717 Catch That Cow (BFS)
Catch That Cow Problem Description Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number li...
分类:其他好文   时间:2014-05-21 07:02:40    阅读次数:312
POJ2236 wireless network 【并查集水题】
一张图上分布着n台坏了的电脑,并知道它们的坐标。两台修好的电脑如果距离 #include #include #include #include #include #include const int MAXN=111111; const int MAX_N=111111; int n,d; using namespace std; struct po { int x,y; boo...
分类:Web程序   时间:2014-05-21 06:29:47    阅读次数:418
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!