码迷,mamicode.com
首页 >  
搜索关键字:状压    ( 1865个结果
状压DP [POJ 3254] Corn Fields
Corn FieldsTime Limit:2000MSMemory Limit:65536KTotal Submissions:8326Accepted:4434DescriptionFarmer John has purchased a lush new rectangular pasture ...
分类:其他好文   时间:2014-11-15 12:45:43    阅读次数:219
uva live 12846 A Daisy Puzzle Game
如果下一个状态有必败,那么此时状态一定是必胜,否则此时状态一定是必败 状压DP #include #include #include #include #include #include #include #include #include #include using namespace std; int dp[1<<20]; int n; int dfs(int state) {...
分类:其他好文   时间:2014-11-14 22:50:05    阅读次数:172
hdu 4778 Gems Fight!
第一次写状压dp…… 题意:http://blog.csdn.net/dyx404514/article/details/15506601 状压dp+博弈吧…… #include #include #include #include #include #include #include #include #include #include using namespace std; int d...
分类:其他好文   时间:2014-11-14 19:49:04    阅读次数:216
HDU 3681 Prison Break floyd+状压+二分
题目链接:点击打开链接 题意: 给定n*m的矩阵: F:起点(有且仅有一个) D:坏点(不能走到这个点) G:能量池(走到这个点可以选择使用这个点的能量池,把电池充满,也可以暂时不用,只能使用一次) Y:目标点 问: 遍历所有Y点需要最小的电池容量是多少。 开始电池满电,每走一步消耗一格电。 Y+G的个数 思路:状压YG,前面几位表示Y,后面几位表示G。 先跑个floyd,...
分类:其他好文   时间:2014-11-14 19:48:25    阅读次数:278
hdu--1429--状压bfs
做这题 来为上年 上海的那个状压bfs做铺垫 =_=这题 不难 就是 多开一维 存下 钥匙的状态就好了 表示在 (x,y)这个坐标点 已经收集到了哪些钥匙多做点 状压的题目 就会来感觉的. 1 #include 2 #include 3 #include 4 using namespace s...
分类:其他好文   时间:2014-11-14 19:27:10    阅读次数:177
POJ 3254 Corn Fields(状压dp)
POJ 3254 Corn Fields(状压dp)...
分类:其他好文   时间:2014-11-12 21:17:42    阅读次数:217
【状压+二分+BFS】HDU 3681 Prison Break
通道:http://acm.hdu.edu.cn/showproblem.php?pid=3681题意:机器人从F出发,走到G可以充电,D不能走进,走到Y关掉开关,要求把所有开关关掉,且电量最少,并求出初始最小电量。思路:二分初始的电量,预处理任意G,Y,F之间的最短距离,然后状压dp[s][u]:...
分类:其他好文   时间:2014-11-12 01:58:49    阅读次数:211
hdu 3341 Lost's revenge(AC自动机+变进制状压DP)
题目链接:hdu 3341 Lost's revenge 题目大意:给定一些需要匹配的串,然后在给定一个目标串,现在可以通过交换目标串中任意两个位置的字符,要求最 后生成的串匹配尽量多的匹配串,可以重复匹配。 解题思路:这题很明显是AC自动机+DP,但是dp的状态需要开40?40?40?40(记录每种字符的个数),空间承受 不了,但是其实因为目标串的长度有限,为40;所以状...
分类:其他好文   时间:2014-11-12 00:47:27    阅读次数:265
poj 1699 Best Sequence(AC自动机+状压DP)
题目链接:poj 1699 Best Sequence 题目大意;给定N个DNA序列,问说最少多长的字符串包含所有序列。 解题思路:AC自动机+状压DP,先对字符串构造AC自动机,然后在dp[s][i]表示匹配了s,移动到节点i时候的最短步数。 #include #include #include #include #include #include using nam...
分类:其他好文   时间:2014-11-11 22:52:22    阅读次数:288
POJ 3311 Hie with the Pie(状压DP + Floyd)
POJ 3311 Hie with the Pie(状压DP + Floyd)...
分类:其他好文   时间:2014-11-10 19:57:14    阅读次数:267
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!