
期望
文章平均质量分 65
墨碎江南
这个作者很懒,什么都没留下…
展开
-
Race to 1 Again LightOJ - 1038
Rimi learned a new thing about integers, which is - any positive integer greater than 1 can be divided by its divisors. So, he is now playing with this property. He selects a number N. And he calls th...原创 2018-10-12 11:03:51 · 167 阅读 · 0 评论 -
Domination ZOJ - 3822 (概率dp 求期望)
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 chessboard with N rows and M columns.E...原创 2018-11-09 15:45:31 · 149 阅读 · 0 评论 -
Lights inside 3D Grid LightOJ - 1284
题解:概率计数。因为是求期望值,考虑每个点对答案的贡献:对每个点是亮着的概率求和就是所求期望。那么每个点亮着的概率为多少呢?根据题意,对于点(x,y,z)只有当被选中的2个点(x1,y1,z1),(x2,y2,z2),满足x1<=x<=x2且y1<=y<=y2且z1<=z<=z2时,该点的状态才会改变,因此对于每一维,在区间内的概率=1-区间在该点的...原创 2018-10-17 18:37:29 · 141 阅读 · 0 评论 -
A Dangerous Maze (II)
https://blog.youkuaiyun.com/qq_31759205/article/details/54710164题解:期望dp,设正确的门有a个,平均耗时为sum1,错误的门有b个,平均耗时为sum2。状态转移分2部分:①当i==k时,即已经记住k次走错的门,②当i<k时,#include<bits/stdc++.h>using namespace ...转载 2018-10-22 16:16:13 · 170 阅读 · 0 评论 -
Beating the Dataset LightOJ - 1274
You are in a contest, and unfortunately you don't have much time. You have one problem in hand; you just glanced at the sample output and found that it just wants 'YES' or 'NO'. So, you have made anot...原创 2018-10-17 10:48:25 · 288 阅读 · 0 评论 -
Batting Practice LightOJ - 1408
After being all out for 58 and 78 in two matches in the most prestigious tournament in the world, the coach of a certain national cricket team was very upset. He decided to make the batsmen practice a...原创 2018-10-19 11:11:10 · 181 阅读 · 0 评论 -
洛谷 P2473 [SCOI2008]奖励关 (求期望的状压dp)
你正在玩你最喜欢的电子游戏,并且刚刚进入一个奖励关。在这个奖励关里,系统将依次随机抛出k次宝物,每次你都可以选择吃或者不吃(必须在抛出下一个宝物之前做出选择,且现在决定不吃的宝物以后也不能再吃)。宝物一共有n种,系统每次抛出这n种宝物的概率都相同且相互独立。也就是说,即使前k-1 次系统都抛出宝物1(这种情况是有可能出现的,尽管概率非常小),第k次抛出各个宝物的概率依然均为1/n。获取第 ...原创 2018-09-30 15:09:03 · 196 阅读 · 0 评论 -
Dice (III) LightOJ - 1248
Given a dice with n sides, you have to find the expected number of times you have to throw that dice to see all its faces at least once. Assume that the dice is fair, that means when you throw the dic...原创 2018-10-14 19:52:46 · 135 阅读 · 0 评论 -
Birthday Paradox LightOJ - 1104
Sometimes some mathematical results are hard to believe. One of the common problems is the birthday paradox. Suppose you are in a party where there are 23 people including you. What is the probability...原创 2018-10-14 17:01:49 · 147 阅读 · 0 评论 -
Just another Robbery LightOJ - 1079(概率)
As Harry Potter series is over, Harry has no job. Since he wants to make quick money, (he wants everything quick!) so he decided to rob banks. He wants to make a calculated risk, and grab as much mone...原创 2018-10-13 20:33:56 · 145 阅读 · 0 评论 -
Snakes and Ladders LightOJ - 1151 (求期望 高斯消元)
'Snakes and Ladders' or 'Shap-Ludu' is a game commonly played in Bangladesh. The game is so common that it would be tough to find a person who hasn't played it. But those who haven't played it (unluck...原创 2018-11-12 16:11:28 · 439 阅读 · 0 评论