![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
概率dp
文章平均质量分 87
tomjobs
别慌,慌也没用
展开
-
Google Kickstart Round-D C. Beauty of tree(期望DP)
Problem Amadea and Bilva are decorating a rooted tree containing N nodes, labelled from 1 to N. Node 1 is the root of the tree, and all other nodes have a node with a numerically smaller label as their parent. Amadea and Bilva’s decorate the tree as follow原创 2021-03-09 14:07:12 · 202 阅读 · 0 评论 -
D - Darts Gym - 102470D(概率DP,博弈)
题意: 两个人在飞镖射击,射到不同地方有不同分数,分数先到0则获胜。 A随机射击,B指定一个位置,最终射击结果为这个位置和相邻两个位置。 求A先手和B先手的获胜概率。 思路: 记忆化搜索,两个人分数都小于等于20的时候,结果肯定是固定的,因为射击到分数大的分数不变,分数小的状态也不变,只有是射击到刚好自己分数的时候,才会获胜。 定义f[i][j][0/1]f[i][j][0/1]f[i][j][0/1]为A分数为i,B分数为j,并且A(B)先手时候的获胜概率。 转移就是每次枚举自己射击的那个位置。 不过本题原创 2020-10-04 10:35:28 · 216 阅读 · 0 评论 -
Bag of mice CodeForces - 148D(概率dp)
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 sh...原创 2020-02-17 15:46:14 · 165 阅读 · 0 评论 -
BZOJ1419: Red is good(期望dp)
Description 桌面上有R张红牌和B张黑牌,随机打乱顺序后放在桌面上,开始一张一张地翻牌,翻到红牌得到1美元,黑牌则付出1美元。可以随时停止翻牌,在最优策略下平均能得到多少钱。 Input 一行输入两个数R,B,其值在0到5000之间 Output 在最优策略下平均能得到多少钱。 Sample Input 5 1 Sample Output 4.166666 HINT 输出答案时,小数点后...原创 2020-02-17 12:30:17 · 245 阅读 · 0 评论 -
BZOJ1426. 收集邮票(期望dp)
Description 有n种不同的邮票,皮皮想收集所有种类的邮票。唯一的收集方法是到同学凡凡那里购买,每次只能买一张,并且 买到的邮票究竟是n种邮票中的哪一种是等概率的,概率均为1/n。但是由于凡凡也很喜欢邮票,所以皮皮购买第k 张邮票需要支付k元钱。现在皮皮手中没有邮票,皮皮想知道自己得到所有种类的邮票需要花费的钱数目的期望。 Input 一行,一个数字N N<=10000 Output...原创 2020-02-17 11:30:46 · 433 阅读 · 0 评论 -
BZOJ3450. Tyvj1952 Easy(期望dp)
Description 某一天WJMZBMR在打osu~~~但是他太弱逼了,有些地方完全靠运气:( 我们来简化一下这个游戏的规则 有n次点击要做,成功了就是o,失败了就是x,分数是按comb计算的,连续a个comb就有aa分,comb就是极大的连续o。 比如ooxxxxooooxxx,分数就是22+4*4=4+16=20。 Sevenkplus闲的慌就看他打了一盘,有些地方跟运气无关要么是o要么是...原创 2020-02-16 21:11:50 · 308 阅读 · 0 评论 -
BZOJ2318. Spoj4060 game with probability Problem(概率DP)
题目描述 Alice and Bob play the following game. First, they collect N small stones and put them together in one pile. After that, they throw a coin one by one. Alice starts first. If a player throws heads...原创 2020-02-16 18:40:14 · 285 阅读 · 0 评论 -
BZOJ1076. [SCOI2008]奖励关(期望dp/状压/逆序)
题目描述 你正在玩你最喜欢的电子游戏,并且刚刚进入一个奖励关。在这个奖励关里,系统将依次随机抛出k次宝物, 每次你都可以选择吃或者不吃(必须在抛出下一个宝物之前做出选择,且现在决定不吃的宝物以后也不能再吃)。 宝物一共有n种,系统每次抛出这n种宝物的概率都相同且相互独立。也就是说,即使前k-1次系统都抛出宝物1( 这种情况是有可能出现的,尽管概率非常小),第k次抛出各个宝物的概率依然均为1/n...原创 2019-10-10 15:44:56 · 202 阅读 · 0 评论 -
Collecting Bugs POJ - 2096(期望dp)
Ivan is fond of collecting. Unlike other people who collect post stamps, coins or other material stuff, he collects software bugs. When Ivan gets a new program, he classifies all possible bugs into n ...原创 2020-02-09 16:51:03 · 416 阅读 · 0 评论