随笔分类 -  动态规划-概率DP

摘要:https://www.luogu.com.cn/problem/P1654 期望 我们转换为计算每一步增加得分的期望 得分的情况 \[ (x+1)^3-x^3=3x^2+3x+1 \] 计算$x^2$,$x$的期望,即可求得每一步增加得分的期望 #include<cstdio> #include< 阅读全文
posted @ 2020-08-14 11:36 GK0328 阅读(56) 评论(0) 推荐(0)
摘要:https://www.luogu.com.cn/problem/P3750 期望$DP$ 运用贪心的策略,如果我们想要尽快关闭所有的灯,显然从编号大的到编号小的关更优 那么我们可以计算出关灯的最小次数$cnt$ 如果$cnt \le k$,显然答案就是$cnt$ 如果$cnt > k$,我们考虑$ 阅读全文
posted @ 2020-08-07 20:46 GK0328 阅读(81) 评论(0) 推荐(0)
摘要:https://www.luogu.com.cn/problem/UVA10529 概率$DP$ 若一件事发生的概率为$p$,那么该事件发生的概率为$\frac{1}$ 达到骨牌不倒的期望次数为: \[ \frac{1}{1-pl-pr} \] 所以骨牌倒的期望次数为: \[ \frac{1}{1- 阅读全文
posted @ 2020-08-06 15:08 GK0328 阅读(77) 评论(0) 推荐(0)