码迷,mamicode.com
首页 >  
搜索关键字:状压    ( 1865个结果
hdu3182---Hamburger Magi(状压dp)
Problem Description In the mysterious forest, there is a group of Magi. Most of them like to eat human beings, so they are called “The Ogre Magi”, but there is an special one whose favorite food is ha...
分类:其他好文   时间:2015-04-28 14:08:31    阅读次数:129
POJ 1753 BFS+状压
给出4*4的黑白棋盘 可以对任意一个点进行翻转(黑->白,或 白->黑),同时会翻转其相邻的四个点 问最少的步骤使棋盘变成全黑或者全白,状压存状态即可 #include "stdio.h" #include "string.h" #include "queue" using namespace std; int dir[5][2]={ {1,0},{-1,0},{0,1},{0,-...
分类:其他好文   时间:2015-04-27 16:52:22    阅读次数:140
HDU 1074 Doing Homework
这道题想了很久,总觉得状态太多,情况太多,用dp根本不知道该怎么写 看了网上的解题报告,说是用状压dp,即dp[i]记录完成哪几个作业所扣分的最小值,然后递推公式是:dp[i]=min(dp[i],max(dp[i-(1 sum[i]即到该状态时已经花费的时间,cost[j]表示第j个作业需要花费的赶时间,dead[j]表示第j个作业的deadline 由于考虑第i个状态的时候,i状态可以由...
分类:其他好文   时间:2015-04-25 15:12:38    阅读次数:107
POJ2923——背包DP(01+状压)——Relocation
DescriptionEmma and Eric are moving to their new house they bought after returning from their honeymoon. Fortunately, they have a few friends helping ...
分类:其他好文   时间:2015-04-25 10:40:38    阅读次数:121
hdu 1429 bfs+状压
题意:这次魔王汲取了上次的教训,把Ignatius关在一个n*m的地牢里,并在地牢的某些地方安装了带锁的门,钥匙藏在地牢另外的某些地方。刚开始 Ignatius被关在(sx,sy)的位置,离开地牢的门在(ex,ey)的位置。Ignatius每分钟只能从一个坐标走到相邻四个坐标中的其中一 个。魔王每t...
分类:其他好文   时间:2015-04-25 09:19:34    阅读次数:159
ZOJ3471---Most Powerful(状压dp)
Recently, researchers on Mars have discovered N powerful atoms. All of them are different. These atoms have some properties. When two of these atoms collide, one of them disappears and a lot of power i...
分类:其他好文   时间:2015-04-24 19:14:37    阅读次数:116
cf298F:状压dp+剪枝
div2的F题,只想到了一个复杂度略高的dp,T了几次,后来加了剪枝减掉一些无用的状态终于过了。。题意:一个n*m的矩阵 (n 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using name...
分类:其他好文   时间:2015-04-24 12:24:48    阅读次数:147
HDU 4336 Card Collector(概率dp+状压)
Card Collector Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3014    Accepted Submission(s): 1445 Special Judge Problem Description In...
分类:其他好文   时间:2015-04-23 09:39:54    阅读次数:134
ZOJ 3471 Most Powerful(状压DP)
Description Recently, researchers on Mars have discovered N powerful atoms. All of them are different. These atoms have some properties. When two of these atoms collide, one of them disappears and ...
分类:其他好文   时间:2015-04-19 06:33:12    阅读次数:115
Topcoder SRM655 DIV2 950 NineEasy 状压 + 数位 dp
题意:要你构造一个n位的数子 ,给你m(1-5)个询问,每一次询问取一些位数的数组成一个新数且这个数 %9 == 0 , 问你要满足这m个询问的数字有多少个(允许前缀0)。解题思路:把每一种情况状压,得到一个最多 9x9x9x9x9 的情况,然后根据 每个数的询问决定状态转移方程。解题代码: 1 ....
分类:其他好文   时间:2015-04-16 21:22:06    阅读次数:145
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!