
概率与数学期望
文章平均质量分 91
xuanweiace
一个热爱算法竞赛的弱校ACMer路过。青大本,浙大硕,方向后端开发,菜鸡一枚,奋斗ing...
展开
-
【CodeForces - 697D】Puzzles(树形dp,期望dp)
题目大意:给定一棵树,从1开始,按DFS的方式访问这棵树每次从父亲节点随机访问儿子,问每个节点被访问到的时间的期望输入:第一行一个数n,代表n个节点。第二行n-1个数p2,p3,p4,p5...,pn-1,其中pi代表i号节点的父节点编号,1号节点一定是根节点。ExamplesInput71 2 1 1 4 4Output1.0 4.0 5.0 3.5 4....原创 2019-10-14 19:17:04 · 313 阅读 · 0 评论 -
【HDU - 6574】Rng(概率,古典概型)
题干:Avin is studying how to synthesize data. Given an integer n, he constructs an interval using the following method: he first generates a integer r between 1 and n (both inclusive) uniform-randomly...原创 2019-09-13 22:28:55 · 739 阅读 · 4 评论 -
【2019icpc徐州站】Random Access Iterator(概率dp,有坑,tricks)
题干:Recently Kumiko learns to use containers in C++ standard template library.She likes to use thestd::vectorvery much. It is very convenient for her to do operations like an ordinary array. Howe...原创 2019-09-13 22:16:00 · 358 阅读 · 0 评论 -
【ZOJ - 3329】One Person Game(带循环的概率dp,数学期望,高斯消元,数学)
题干:There is a very simple and interesting one-person game. You have 3 dice, namelyDie1,Die2andDie3.Die1hasK1faces.Die2hasK2faces.Die3hasK3faces. All the dice are fair dice, so the pr...原创 2019-07-28 14:53:49 · 277 阅读 · 0 评论 -
【POJ - 2096】Collecting Bugs(概率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 in...原创 2019-07-28 11:48:13 · 251 阅读 · 0 评论 -
【Gym - 101606F】Flipping Coins(概率dp)
题干:Here’s a jolly and simple game: line up a row ofNidentical coins, all with the heads facing down onto the table and the tails upwards, and for exactlyKtimes take one of the coins, toss it int...原创 2019-07-28 11:49:36 · 304 阅读 · 0 评论 -
【BZOJ - 3036】绿豆蛙的归宿(概率DAG图dp,拓扑排序,概率dp,期望的线性性)
题干:随着新版百度空间的下线,Blog宠物绿豆蛙完成了它的使命,去寻找它新的归宿。给出一个有向无环的连通图,起点为1终点为N,每条边都有一个长度。绿豆蛙从起点出发,走向终点。到达每一个顶点时,如果有K条离开该点的道路,绿豆蛙可以选择任意一条道路离开该点,并且走向每条路的概率为 1/K 。现在绿豆蛙想知道,从起点走到终点的所经过的路径总长度期望是多少?Input第一行: 两个整数...原创 2019-07-31 21:18:40 · 438 阅读 · 0 评论 -
*【CodeForces - 280C】Game on Tree(期望模型,期望的线性性)
题干:Momiji has got a rooted tree, consisting ofnnodes. The tree nodes are numbered by integers from1ton. The root has number1. Momiji decided to play a game on this tree.The game consists of ...原创 2019-07-28 11:49:45 · 235 阅读 · 0 评论 -
【LightOJ - 1104】Birthday Paradox(概率,思维)
题干: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 are23people including you. What is the probab...原创 2019-07-31 21:20:36 · 255 阅读 · 0 评论 -
【BZOJ - 4318】OSU!(概率dp,数学期望,期望的线性性)
题干:osu 是一款群众喜闻乐见的休闲软件。我们可以把osu的规则简化与改编成以下的样子:一共有n次操作,每次操作只有成功与失败之分,成功对应1,失败对应0,n次操作对应为1个长度为n的01串。在这个串中连续的 X个1可以贡献X^3 的分数,这x个1不能被其他连续的1所包含(也就是极长的一串1,具体见样例解释)现在给出n,以及每个操作的成功率,请你输出期望分数,输出四舍五入后...原创 2019-08-05 19:55:10 · 362 阅读 · 0 评论 -
【BZOJ - 3450】Tyvj1952 Easy(数学期望,期望的线性性)
题干:某一天WJMZBMR在打osu~~~但是他太弱逼了,有些地方完全靠运气:(我们来简化一下这个游戏的规则有n次点击要做,成功了就是o,失败了就是x,分数是按comb计算的,连续a个comb就有a*a分,comb就是极大的连续o。比如ooxxxxooooxxx,分数就是2*2+4*4=4+16=20。Sevenkplus闲的慌就看他打了一盘,有些地方跟运气无关要么是o要么是x,有些地...原创 2019-08-05 19:55:00 · 793 阅读 · 0 评论 -
【CodeForces - 518D】Ilya and Escalator(概率dp,数学期望)
题干:Ilya got tired of sports programming, left university and got a job in the subway. He was given the task to determine the escalator load factor.Let's assume thatnpeople stand in the queue for...原创 2019-08-05 19:55:35 · 392 阅读 · 0 评论 -
【LightOJ - 1079】Just another Robbery(概率dp,概率背包)
题干: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...原创 2019-07-31 21:19:50 · 306 阅读 · 0 评论 -
【LightOJ - 1038】Race to 1 Again(概率dp,数学期望)
题干:Rimi learned a new thing about integers, which is - any positive integer greater than1can be divided by its divisors. So, he is now playing with this property. He selects a numberN. And he cal...原创 2019-07-31 21:20:56 · 258 阅读 · 0 评论 -
【LightOJ - 1030】Discovering Gold(概率dp,数学期望,期望的线性性)
题干:You are in a cave, a long cave! The cave can be represented by a1 x Ngrid. Each cell of the cave can contain any amount of gold.Initially you are in position1. Now each turn you throw a perf...原创 2019-07-31 21:19:30 · 268 阅读 · 0 评论 -
【LightOJ - 1027】A Dangerous Maze(概率dp,数学期望)
题干:You are in a maze; seeingndoors in front of you in beginning. You can choose any door you like. The probability for choosing a door is equal for all doors.If you choose theithdoor, it can e...原创 2019-07-31 21:20:19 · 291 阅读 · 0 评论