![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
———状态压缩
MissZhou要努力
不晓日月,不辩兰艾,终日碌碌,安与燕雀相随乎
展开
-
zoj3471&nefu1109游戏争霸赛【状态压缩】
description 亏你能想的出来这么个背景……2015年英雄联盟校园争霸赛决赛于北京时间7月31日在东北林业大学体育馆举行。经过初选的洗礼后,有来自全国各地的n支队伍汇集到本次总决赛,比赛最终要角逐出一名冠军。规则是:队伍两两之间进行比赛,失败者被淘汰,胜利者晋级,获得和其他队伍进行较量的资格,并且为本场比赛贡献一定的精彩度。比如:i和j比赛,j被淘汰,那么比赛增加a原创 2016-01-03 11:22:20 · 623 阅读 · 0 评论 -
hdu4057 Rescue the Rabbit【AC自动机+dp滚动数组】
DescriptionDr. X is a biologist, who likes rabbits very much and can do everything for them. 2012 is coming, and Dr. X wants to take some rabbits to Noah's Ark, or there are no rabbits any more.原创 2016-03-16 21:46:22 · 724 阅读 · 0 评论 -
hdu2825Wireless Password【ac自动机+dp状态压缩】
Total Submission(s): 5502 Accepted Submission(s): 1737Problem DescriptionLiyuan lives in a old apartment. One day, he suddenly found that there was a wireless network in the building. Liy原创 2016-03-15 17:15:16 · 1534 阅读 · 0 评论 -
hdu1513Palindrome【最长公共子序列&滚动数组】
问加几个字符能变成回文串==赤裸裸的LCS 而且都不用记录路径/************hdu15132016.2.12483MS 1616K 975 B G++************/#include #include#includeusing namespace std;int c[2][5005],n,sum;char x[5005],y[5005];void原创 2016-02-12 15:32:29 · 604 阅读 · 0 评论 -
poj1038Bugs Integrated, Inc.【三进制状态压缩】
本来是看这个题是课件上推荐的题当中AC率最高的,结果还看了两天才看明白T^T,三进制状态压缩,什么鬼东西,一个DP居然还要100行代码,太不像话了==参考博客:http://www.cnblogs.com/vongang/archive/2012/07/30/2615322.html http://www.cnblogs.com/yefeng1627/archive/2013/01/15原创 2016-01-05 21:53:35 · 1368 阅读 · 1 评论 -
hdu2553 N皇后问题【二进制状态压缩基础】
rt,二进制压缩的入门题,依旧卡了一个多小时,还不算之前看的那一遍orz本题要求行列两个斜线都不能多于一个,就算是一行一行遍历,也需要考虑状态的转移方法及记录转移的方法,那么,二进制华丽丽的出场啦~~当前位有就是1,没有就是0,这点是毋庸置疑的,那如何用上一状态表示下一可能的状态呢?col表示列,fir表示左对角线,sec表示右对角线,三个数字作为参数代入递归函数,那么下一步能去的集合是(原创 2016-01-04 11:51:01 · 1258 阅读 · 1 评论 -
hdu1158Employment Planning dp 滚动数组
Problem DescriptionA project manager wants to determine the number of the workers needed in every month. He does know the minimal number of the workers needed in each month. When he hires or fires a原创 2015-10-06 17:32:27 · 419 阅读 · 0 评论 -
hdu1024Max Sum Plus Plus【状态dp 滚动数组】
Problem DescriptionNow I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challenge ourselves to more difficult problems. Now you are faced with a more diff原创 2015-10-04 11:00:21 · 518 阅读 · 0 评论 -
hdu1074Doing Homework【状态压缩】
Problem DescriptionIgnatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ignatius hands in原创 2016-01-07 09:45:40 · 1560 阅读 · 2 评论 -
Hdu 4568 Hunter【spfa最短路 tsp状态压缩】
Description One day, a hunter named James went to a mysterious area to find the treasures. James wanted to research the area and brought all treasures that he could. The area can be represen原创 2016-03-17 17:12:18 · 887 阅读 · 0 评论 -
poj2411Mondriaan's Dream【覆盖类状压dp】
DescriptionSquares and rectangles fascinated the famous Dutch painter Piet Mondriaan. One night, after producing the drawings in his 'toilet series' (where he had to use his toilet paper to draw o原创 2016-03-22 21:13:25 · 601 阅读 · 0 评论 -
hdu4758Walk Through Squares【AC自动机+dp】
On the beaming day of 60th anniversary of NJUST, as a military college which was Second Artillery Academy of Harbin Military Engineering Institute before, queue phalanx is a special landscape.原创 2016-03-18 16:47:37 · 524 阅读 · 0 评论 -
hdu1565方格取数(1)【状态压缩】
78节课的时候看了两个记忆化搜索的题,居然~都!不!会!那就做原来计划的状态压缩吧,然而看题解都不懂,看代码发现自己太弱T^T二进制枚举方案数都不会用。能猜到的唯一是既然是状态压缩,就是要从上一行到下一行的时候数组循环利用orz晚上状态也不好,胃好涨,两个小时踉踉跄跄才搞完这个题。据说这个题正解是最小割。等假期刷图论吧/**********hdu15652015.12.12639MS 1原创 2015-12-22 20:18:10 · 512 阅读 · 0 评论 -
CF417DCunning Gena【状态压缩DP】
总感觉之前做过类似的==不出所料是一个dp,然而确实不会,一直卡在状态转移的下标怎么转化这个问题上,思维定式的以为转移就只能是+1、-1(⊙﹏⊙)b既然要求的东西是与二进制有关,那转移也这么写不就得了嘛 再说说排序的问题,之前也考虑过要怎么找最小值的时候即考虑监视器的数又考虑给每个人的钱数~。~ 其实这里也有贪心的思想吧,最开始进行计算的是需要监视器较少的,这个结构体按照监视器的数量由小到大排原创 2015-12-09 19:47:20 · 510 阅读 · 0 评论 -
2014上海网络赛1004||hdu5045 contest【状态压缩dp】
题意:m小时之间每个小时有新出的一个题供n个人中的一个人做,每个人做出的概率已知,每一时刻任意两个人做出的题数之差不得多于1个,问最多答题的个数之前的状压都是三重循环是同一个数来的,然而这个题让我重新认识了状压QAQ1.状压读数的话一定要从0开始啊啊啊,要不取状态值会很费劲的2.做过状压都知道,第一重循环和第三重循环都是正常的数,第二重循环是状态。从“凑数”的角度看,第二重循环和第三重循环也得是n,第一重循环是m。从正常的解释来看,第一重循环推的是每个题,第二重循环是某人做过哪些题,第三重循环是原创 2016-04-22 16:52:35 · 406 阅读 · 0 评论 -
hdu4753Fishhead’s Little Game【状态压缩记忆化搜索+博弈】
Problem Description There is a 3 by 3 grid and each vertex is assigned a number. It looks like JiuGongGe, but they are different, for we are not going to fill the cell but the edge. For原创 2016-03-28 09:55:37 · 683 阅读 · 0 评论 -
hdu3001Travelling【三进制TSP】
Problem DescriptionAfter coding so many days,Mr Acmer wants to have a good rest.So travelling is the best choice!He has decided to visit n cities(he insists on seeing all the cities!And he does not原创 2016-03-25 10:38:44 · 875 阅读 · 0 评论 -
poj3311 Hie with the Pie【floyd最短路+状态压缩】
DescriptionThe Pizazz Pizzeria prides itself in delivering pizzas to its customers as fast as possible. Unfortunately, due to cutbacks, they can afford to hire only one driver to do the deliveri原创 2016-03-24 20:54:22 · 726 阅读 · 0 评论 -
poj1185炮兵阵地【状压dp】
Description司令部的将军们打算在N*M的网格地图上部署他们的炮兵部队。一个N*M的地图由N行M列组成,地图的每一格可能是山地(用"H" 表示),也可能是平原(用"P"表示),如下图。在每一格平原地形上最多可以布置一支炮兵部队(山地上不能够部署炮兵部队);一支炮兵部队在地图上的攻击范围如图中黑色区域所示:如果在地图中的灰色所标识的平原上部署一支炮兵部队,则图中的黑色的网格表原创 2016-03-23 20:48:37 · 467 阅读 · 0 评论 -
Wannafly挑战赛8 C 小C打比赛
题目描述 https://www.nowcoder.com/acm/contest/57/C小C现在要参加一场wannafly挑战赛,一场挑战赛一共有n道题,一共有m分钟。对于第i道题,小C解决它需要恰好j分钟的概率是pi,j。小C每次会选择某一道没做完的题,然后把它解决(不能中途放弃),之后再决策下一道要做的题是哪道。求小C在最优策略下,期望能做出几道题。输原创 2018-01-20 15:58:22 · 464 阅读 · 0 评论