CodeForces 148D Bag of mice 详解 (概率DP)

博客探讨了在概率动态规划问题中解决CodeForces的一道题目,涉及两个角色通过从含有一定数量白鼠和黑鼠的袋子中轮流抽取来决定赢家。公主先抽,若抽取到白鼠则获胜。每次龙抽取后,会有一只老鼠因恐慌跳出袋子。如果最后没有老鼠且未出现白鼠,则龙获胜。博客详细解释了每一步的概率计算,并给出了一个样例解析。
摘要由CSDN通过智能技术生成


D. Bag of mice
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

The dragon and the princess are arguing about what to do on the New Year's Eve. The dragon suggests flying to the mountains to watch fairies dancing in the moonlight, while the princess thinks they should just go to bed early. They are desperate to come to an amicable agreement, so they decide to leave this up to chance.

They take turns drawing a mouse from a bag which initially contains w white and b black mice. The person who is the first to draw a white mouse wins. After each mouse drawn by the dragon the rest of mice in the bag panic, and one of them jumps out of the bag itself (the princess draws her mice carefully and doesn't scare other mice). 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值