ZOJ 3551 Bloodsucker <概率DP>】的更多相关文章

题目:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3551 题意:开始有N-1个人和一个吸血鬼, 每天有两个生物见面,当人遇到吸血鬼时有p的概率变成吸血鬼,求全部变成吸血鬼所需要的时间的期望~ 思路: 设dp[i] 为还有 i 个人时,有一人变成吸血鬼的期望时间, p[i]为还有 i 个人时,有人变成吸血鬼的概率, 那么p[i]= p*i(N-i)/(N*(N-1)/2)~  dp[i]=1/p[i]; 由 E(X)=…
题目:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4530 dp[i]表示现在存在i个吸血鬼要达成目标(全为吸血鬼)天数的数学期望假如现在再增加一天,这一天可能会增加一个吸血鬼,p1*(dp[i+1]+1)表示接下来的一天增加了一个吸血鬼,所以为(dp[i+1]+1),还有一种可能就是没有增加吸血鬼,概率自然是(1-p1)dp[i]+1表示接下来的一天没有增加吸血鬼,但向后推移了一天因此dp[i]这个状态可以转移到dp[i…
解题报告链接: http://www.cnblogs.com/183zyz/archive/2012/09/13/2683524.html 做法:设当有i个吸血鬼时变成n个吸血鬼的天数的数学期望为dp[i]. pi为人和吸血鬼相遇的概率,pi = i*(n-i)/cn2 . cn2表示从n个人中选两个人出来的选法,那么人和吸血鬼相遇的选法为i*(n-i).p为人变吸血鬼的概率. 则有dp[i] = p*pi*(dp[i+1]+1)+(1-p*pi)(dp[i+1]+1) 化为:dp[i] = d…
题目链接 \(Description\) 有1个吸血鬼和n-1个人,每天有且只会有两个人/吸血鬼相遇,如果是人与吸血鬼相遇,那个人会有p的概率变成吸血鬼:否则什么也不发生.求n个都变成吸血鬼的期望天数. \(Solution\) 我还是写一下吧..期望题一般倒着递推. 设\(f[i]\)为当前有\(i\)个吸血鬼,要变成\(n\)个吸血鬼的期望天数.那么\(f[n]=0\),答案即\(f[1]\). 一天要么变一个要么不变,很好想到: \[f[i]=p_i(f_{i+1}+1)+(1-p_i)(…
转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud Bloodsucker Time Limit: 2 Seconds      Memory Limit: 65536 KB In 0th day, there are n-1 people and 1 bloodsucker. Every day, two and only two of them meet. Nothing will happen if they are of…
ZOJ Problem Set - 3822 Domination Time Limit: 8 Seconds      Memory Limit: 131072 KB      Special Judge Edward is the headmaster of Marjar University. He is enthusiastic about chess and often plays chess with his friends. What's more, he bought a lar…
题目链接 参考博客:http://blog.csdn.net/napoleon_acm/article/details/40020297 题意:给定n*m的空棋盘 每一次在上面选择一个空的位置放置一枚棋子,直至每一行每一列都至少有一个棋子,求放置次数的期望 分析: dp[i][j][k] 表示当前用了<=k个chess ,覆盖了i行j列(i*j的格子 每行至少一个,每列至少一个)的概率. dp[i][j][k] 由 dp[i][j][k-1] , dp[i-1][j][k-1], dp[i][j…
题目链接:problemId=5376">http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5376 Edward is the headmaster of Marjar University. He is enthusiastic about chess and often plays chess with his friends. What's more, he bought a large decorative ch…
Domination Time Limit: 8 Seconds      Memory Limit: 131072 KB      Special Judge Edward is the headmaster of Marjar University. He is enthusiastic about chess and often plays chess with his friends. What's more, he bought a large decorative chessboar…
Domination Time Limit: 8 Seconds      Memory Limit: 131072 KB      Special Judge Edward is the headmaster of Marjar University. He is enthusiastic about chess and often plays chess with his friends. What's more, he bought a large decorative chessboar…