ZOJ 3777-Problem Arrangement(状压DP)】的更多相关文章

题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3777 Time Limit: 2 Seconds      Memory Limit: 65536 KB The 11th Zhejiang Provincial Collegiate Programming Contest is coming! As a problem setter, Edward is going to arrange the order…
The 11th Zhejiang Provincial Collegiate Programming Contest is coming! As a problem setter, Edward is going to arrange the order of the problems. As we know, the arrangement will have a great effect on the result of the contest. For example, it will…
LINK:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3777 题意:有N(\( N <= 12 \))道题,排顺序,当某道题选择了放在第j个位置时,会获得Pij的点数,但其他题目就不能选择j位置了.要求总获得的点数要大于M(\(1 <= M <= 500\)),问在所有方案中选择出合法方案的次数的期望值. 思路:题目要求的期望值,比较简单,就是总方案数和合法方案数的比值.看题目就知道是个DP,重点在于状态设计…
Problem Arrangement Time Limit: 2 Seconds      Memory Limit: 65536 KB The 11th Zhejiang Provincial Collegiate Programming Contest is coming! As a problem setter, Edward is going to arrange the order of the problems. As we know, the arrangement will h…
原题:ZOJ 3777  http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3777 题意:给每个题目安排在每个位置的value.有一个程序随机选择安排的顺序,总的value值大于等于m时,就可以接受这个安排.问能够获得一次满足条件的安排的期望次数. 这题不会做,看网上是用状态压缩DP做的. 定义: dp[i][j]为选取了前i行,趣味和为j的方案种数. 由于程序是每次随机选择一个排列,每次的选择之间不影响,而且每次选中的概…
Simple String Problem Recently, you have found your interest in string theory. Here is an interesting question about strings. You are given a string S of length n consisting of the first k lowercase letters. You are required to find two non-empty sub…
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5264 题意:给出n道题目以及每一道题目不同时间做的兴趣值,让你求出所有做题顺序中兴趣值大于等于m的比例.用一个分数表示. 状压dp. 枚举每一个状态,用二进制表示.dp[i][j]表示第i个题目,兴趣值为j的个数. 转移方程 dp[i|(1<<j)][k+a[num][j]]+=dp[i][k];兴趣值大于m的为 dp[1|(1<<j)][m]+=dp[i][k…
A了一整天~~~终于搞掉了. 真是血都A出来了. 题目意思很清楚,肯定是状压DP. 我们可以联系一下POJ 1185  炮兵阵地,经典的状压DP. 两道题的区别就在于,这道题的攻击是可以被X挡住的,而且攻击的范围不同. 这是这道题的攻击范围. 但是这个攻击范围是会被X挡住的. 所以得在1185上加以改进. 分析: POJ 1185,因为可以隔着障碍物打,所以他每行的状态是一样的,但是这题由于攻击会被挡住,所以每行的状态是不一样的,所以我们预处理的时候就要处理出每一行的状态数,分别保存,然后存下每…
Description The 11th Zhejiang Provincial Collegiate Programming Contest is coming! As a problem setter, Edward is going to arrange the order of the problems. As we know, the arrangement will have a great effect on the result of the contest. For examp…
B - Problem Arrangement Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu Submit Status Practice ZOJ 3777 Description The 11th Zhejiang Provincial Collegiate Programming Contest is coming! As a problem setter, Edward is going…