标签 - 状态压缩

? 解题记录 ? ? 动态规划 ? ? 状态压缩 ?    2018-08-25 08:46:11    920    0    0
【题目描述】给你n个k维0/1向量组成的串a[n]。 定义向量a <= b当且仅当a中每一个1出现的位置在b中都是1 比如{0,1,0,1}<={0,1,0,1}, {0,1,0,1}<={0,1,1,1} 但是{0,1,0,1}和{1,0,0,1}没有这样的关系 现在请你统计这个串中有多少个不下降子序列。 一个子序列是一个1~n组成的序列, 其中每个元素都满足i < j且a[i] <= a[j]。 【输入】第一行两个正整数n,k。n表示串的长度,k表示向量维数 下面n行每一行一个0/1字符串表示一个k维向量 【输出】输出一个整数,表示不下降序列个数。 【输入样例
? 解题记录 ? ? Codeforces ? ? 状态压缩 ?    2018-07-10 17:29:06    642    0    0
There are two small spaceship, surrounded by two groups of enemy larger spaceships. The space is a two-dimensional plane, and one group of the enemy spaceships is positioned in such a way that they all have integer y" data-mce-tabindex="0">yy-coordinates, and their x" data-mce-tabindex=
? 解题记录 ? ? 洛谷 ? ? 状态压缩 ? ? 动态规划 ?    2018-06-09 11:42:31    399    1    1
题目描述King Byteasar believes that Byteotia, a land full of beautiful sights, should attract lots of tourists, who should spend lots of money, which should eventually find their way to the royal treasury. But reality does not live up to his dream. So the king instructed his councilor to look into this
? 解题记录 ? ? 洛谷 ? ? 动态规划 ? ? 状态压缩 ?    2018-05-21 10:58:22    690    0    0
题目描述小Y是一个心灵手巧的女孩子,她喜欢手工制作一些小饰品。她有n颗小星星,用m条彩色的细线串了起来,每条细线连着两颗小星星。 有一天她发现,她的饰品被破坏了,很多细线都被拆掉了。这个饰品只剩下了n?1条细线,但通过这些细线,这颗小星星还是被串在一起,也就是这些小星星通过这些细线形成了树。小Y找到了这个饰品的设计图纸,她想知道现在饰品中的小星星对应着原来图纸上的哪些小星星。如果现在饰品中两颗小星星有细线相连,那么要求对应的小星星原来的图纸上也有细线相连。小Y想知道有多少种可能的对应方式。 只有你告诉了她正确的答案,她才会把小饰品做为礼物送给你呢。 输入输出格式输入格式:   第一行
? 解题记录 ? ? BZOJ ? ? 状态压缩 ? ? 线段树 ?    2018-01-16 07:35:28    592    0    0
【题目背景】在人类智慧的山巅,有着一台字长为 1048576 位的超级计算机,著名理论计算机科学家 P 博士正用它进行各种研究。不幸的是,这天台风切断了电力系统,超级计算机无法工作,而 P 博士明天就要交实验结果了,只好求助于学过 OI 的你. . . . . .【题目描述】P 博士将他的计算任务抽象为对一个整数的操作。具体来说,有一个整数 x ,一开始为 0。接下来有 n 个操作,每个操作都是以下两种类型中的一种:1 a b :将 x 加上整数 a · 2b,其中 a 为一个整数,b 为一个非负整数2 k :询问 x 在用二进制表示时,位权为 2k 的位的值(即这一位上的 1 代表 2k )
? 解题记录 ? ? 洛谷 ? ? 动态规划 ? ? 状态压缩 ?    2017-10-30 23:13:31    369    0    0
题目描述 输入输出格式输入格式:   第一行为N,第二行有N个数,依次为第二列的格子中的数。(1<= N <= 10000)   输出格式:   一个数,即第一列中雷的摆放方案数。   输入输出样例输入样例#1: 复制2 1 1 输出样例#1: 复制2​​  一道很小型的状压,我们用一个二位二进制记录到当前行的时候,当前行的下一格和当前行对应的格子是否为地雷。这样我们就可以根据信息递推状态转移方程,具体见代码:#include<cstdio> #define LL long long #defin
? 解题记录 ? ? HDU ? ? 动态规划 ? ? 矩阵快速幂 ? ? 状态压缩 ?    2017-10-21 11:47:39    545    0    0
Peace small elephantXiao Ming likes playing the international chess ,especially like the elephant(it can move by slant while no barrier), but he think the big elephant of the chess is cruel,and a kind of small elephant is not as cruel as the big elephant. Its attack range is checks on the
? 解题记录 ? ? 动态规划 ? ? BZOJ ? ? 状态压缩 ?    2017-10-19 16:20:09    395    1    0
1231: [Usaco2008 Nov]mixup2 混乱的奶牛Time Limit: 10 Sec  Memory Limit: 162 MBSubmit: 1128  Solved: 655[Submit][Status][Discuss]Description混乱的奶牛 [Don Piele, 2007] Farmer John的N(4 <= N <= 16)头奶牛中的每一头都有一个唯一的编号S_i (1 <= S_i <= 25,000). 奶牛为她们的编号感到骄傲, 所以每一头奶
? 解题记录 ? ? POJ ? ? 线段树 ? ? 状态压缩 ?    2017-10-01 14:27:00    582    0    0
  Chosen Problem Solving and Program design as an optional course, you are required to solve all kinds of problems. Here, we get a new problem. There is a very long board with length L centimeter, L is a positive integer, so we can evenly divide the board into L segments, and they are labe