码迷,mamicode.com
首页 >  
搜索关键字:并查集 hdu    ( 34854个结果
HDU 4640 Island and study-sister(状态压缩)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4640题意:给出一个无向图,边有权值。三个人初始时呆在1号点。在其余n-1个点中有些点要求被遍历到。且除了1号点之外每个点最多只能被一个人遍历。求要求被遍历的点中最后被遍历的点的最小时刻。思路:用f[st...
分类:其他好文   时间:2014-06-23 06:26:56    阅读次数:277
HDU 3213 Box Relations(拓扑排序构造)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3231题意:有n个长方体,四种限制条件。(1)I x y x和y有相交;(2)X/Y/Z x y x的最大X/Y/Z坐标小于y的最大X/Y/Z。构造出这样的n个长方体。思路:首先,XYZ三个方向是可以分开...
分类:其他好文   时间:2014-06-23 06:24:24    阅读次数:168
HDU 4563 御剑术I(背包)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4563题意:一个点开始在原点。有n个命令。第i个命令施加到这个点时,这个点的速度为(Vxi,Vyi),即在x方向的速度为Vxi,在y方向的速度为Vyi。并且这个命令施加到点时之前的速度全部消失。每种命令最...
分类:其他好文   时间:2014-06-23 06:16:16    阅读次数:174
BZOJ 1050 旅行comf(枚举最小边-并查集)
题目链接:http://61.187.179.132/JudgeOnline/problem.php?id=1050题意:给出一个带权图。求一条s到t的路径使得这条路径上最大最小边的比值最小?思路:将边排序。枚举最小边,然后将边一个一个插到并查集里,s和t联通时计算更新答案。struct node{...
分类:其他好文   时间:2014-06-23 06:13:19    阅读次数:221
2014百度之星资格赛题解
比赛链接:点击打开链接,,杭电把比赛关了代码都找不到了。。无责任民科还是mark一下好了。。HDU 4823Energy Conversion把式子变换一下发现是一个等比数列,高速幂就可以。#include#include#include#includeusing namespace std;#de...
分类:其他好文   时间:2014-06-23 00:10:42    阅读次数:333
hust 1546 && hdu 3911 Black And White
题目描述There are a bunch of stones on the beach; Stone color is white or black. Little Sheep has a magic brush, she can change the color of a continuous ...
分类:其他好文   时间:2014-06-22 23:46:15    阅读次数:199
HDU 1195 Open the Lock (双向广搜)
题意:给你初始4个数字和目标4个数字,问是否能由初始经过变换到目标数字; 变换规则:每个数字可以加1(9+1=1)或减1(1-1=9),或交换相邻的数字(最左和最右不是相邻的)。 双向广搜:分别对初始和目标数字进行广搜,vis数组用1和2标记两种已搜索的数字,用mp数组记录状态的步数。 当从前往后搜可以到达2或从后往前搜可以到达1状态则就可以了。。。 #in...
分类:其他好文   时间:2014-06-22 19:38:26    阅读次数:231
HDU 3085 Nightmare Ⅱ (双向广搜)
题意:有M,G两人和鬼魂(Z)在n*m的方格内,M每秒走3步,G每秒走一步,鬼魂每秒走2步,问是否能 不遇到鬼魂下两人相遇,鬼魂可以穿墙(X),人不可以。初始鬼魂有2个。 #include #include #include #include #include #include #include #define M 800 using namespace std...
分类:Web程序   时间:2014-06-22 18:57:14    阅读次数:189
hdu1171 Big Event in HDU
转换为01-背包问题...
分类:其他好文   时间:2014-06-22 17:20:06    阅读次数:152
【HDOJ】3367 Pseudoforest
并查集。 1 #include 2 #include 3 #include 4 5 #define MAXN 10005 6 #define INF 0xffffff 7 8 typedef struct { 9 int c, s, e;10 } edge_st;11 12 ed...
分类:其他好文   时间:2014-06-21 17:29:36    阅读次数:178
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!