期望dp
一条很咸的鱼
这个作者很懒,什么都没留下…
展开
-
星球大战
星球大战 有一棵树。每次可以攻击树上的某棵子树,然后这棵子树上的每条边有12\frac{1}{2}21的概率消失。定义 若攻击以x为根的子树,深度ht(x)为x子树剩余点(与x连通)的最大深度。共q次操作,两种: 1 x.新建一个节点,其父节点为x。2 x.询问若攻击以x为根的子树,x子树的期望深度。 q≤5×105q\leq 5\times10^5q≤5×105 设dp[i][j]为以i为根的...原创 2019-12-20 22:20:20 · 112 阅读 · 0 评论 -
概率dp Lights inside 3D Grid
Lights inside 3D Grid You are given a 3D grid, which has dimensions X, Y and Z. Each of the X x Y x Z cells contains a light. Initially all lights are off. You will have K turns. In each of the K tur...原创 2019-10-22 18:48:28 · 114 阅读 · 0 评论 -
概率dp Discovering Gold
Discovering Gold You are in a cave, a long cave! The cave can be represented by a 1 x N grid. Each cell of the cave can contain any amount of gold. Initially you are in position 1. Now each turn you t...原创 2019-10-22 15:33:26 · 70 阅读 · 0 评论 -
期望dp A Dangerous Maze
A Dangerous Maze You are in a maze; seeing n doors 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 the ith doo...原创 2019-10-22 14:21:43 · 69 阅读 · 0 评论