状压DP
Wang_SF2015
这个作者很懒,什么都没留下…
展开
-
文章标题 POJ 1185 : 炮兵阵地 (状压DP)
题目链接分析:首先我们可以先预处理一行中出所有状态中哪那些状态是可行的,即炮兵不会被放在另一个炮兵的射程内用each数组存储。然后同样预处理出地图每一行的状态,其中高地用1表示,用mp数组存储,这两个数组是我为了判断在第j行中第i个状态是否可行,即each[i]&mp[j],返回1表示有 冲突 然后我们用dp[I][j][k]来表示在第i行中的第j个状态与第n-1行中的第k个状态中炮兵的数量,然后原创 2017-08-09 11:17:51 · 282 阅读 · 0 评论 -
文章标题 POJ 2411 : Mondriaan's Dream (状态压缩DP)
Mondriaan’s Dream转自 http://www.cnblogs.com/scau20110726/archive/2013/03/14/2960448.html#include <iostream> #include <cstdio> #include <cstring> #include <string> #include <queue> #include <set> #includ转载 2017-08-03 08:25:15 · 314 阅读 · 0 评论 -
文章标题 POJ 2441 :Arrange the Bulls(状压DP)
Arrange the BullsFarmer Johnson’s Bulls love playing basketball very much. But none of them would like to play basketball with the other bulls because they believe that the others are all very weak. Fa原创 2017-08-03 09:20:04 · 128 阅读 · 0 评论 -
文章标题 POJ : Rectangular Covering(状压DP)
Rectangular Coveringn points are given on the Cartesian plane. Now you have to use some rectangles whose sides are parallel to the axes to cover them. Every point must be covered. And a point can be co原创 2017-08-03 10:15:43 · 264 阅读 · 0 评论