LightOJ 1287 Where to Run(期望)】的更多相关文章

题目链接:https://vjudge.net/problem/LightOJ-1287 1287 - Where to Run    PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Last night you robbed a bank but couldn't escape and when you just got outside today, the police started ch…
题目链接:http://www.lightoj.com/volume_showproblem.php?problem=1287 题意:给定一个n个点的无向图(0到n-1),你开始在0.你开始遍历这个图,每个点只能被遍历一次.当你在某个点u时,假设u可以到达v1,v2且到达v1或者v2后均可以将其他未遍历的点遍历完,则你在u有三种选择:1.在u再呆5分钟:2.去v1,:3.去v2.概率均为1/3.求遍历完整个图的时间期望. 思路:f[u]=(5+f[u])/(x+1)+(g[u][vi]+f[vi…
题面: Last night you robbed a bank but couldn't escape and when you just got outside today, the police started chasing you. The city, where you live in, consists of some junctions which are connected by some bidirectional roads. 题意: 没读懂,还是看了其他人的博客~~~ 就…
Where to Run Last night you robbed a bank but couldn't escape and when you just got outside today, the police started chasing you. The city, where you live in, consists of some junctions which are connected by some bidirectional roads. Since police i…
Where to Run LightOJ - 1287(概率dp) 题面长长的,看了半天也没看懂题意 不清楚的地方,如何判断一个点是否是EJ 按照我的理解 在一个EJ点处,要么原地停留五分钟接着走,要么直接走,但是这样样例都对不上 mmp,原来是说,在原地停留五分钟后再继续这两种选择 而且题目问的是 求被警察抓的期望时间,实际上却是求遍历完整张图的期望时间,也就是说总是会走是EJ的点 对于每个点来说从该点出发的期望时间\(dp[i] = \frac{dp[i]+5}{cnt+1} + \frac…
Description 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 throw a perfect 6 sided dice. If you get X in the dice a…
题目链接:https://vjudge.net/problem/LightOJ-1274 1274 - Beating the Dataset    PDF (English) Statistics Forum Time Limit: 4 second(s) Memory Limit: 32 MB You are in a contest, and unfortunately you don't have much time. You have one problem in hand; you…
传送门:http://www.lightoj.com/volume_showproblem.php?problem=1030 Discovering Gold Time Limit: 2 second(s) Memory Limit: 32 MB Program Description 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 con…
题目链接:LightOJ - 1030 Description You are in a cave, a long cave! The cave can be represented by a \(1 \times N\) grid. Each cell of the cave can contain any amount of gold. Initially you are in position \(1\). Now each turn you throw a perfect \(6\) s…
https://vjudge.net/problem/LightOJ-1030 题意: 在一个1×N的格子里,每个格子都有相应的金币数,走到相应格子的话,就会得到该格子的金币. 现在从1格子开始,每次摇骰子,他就前进几步,但有一种情况例外,如果当前位置+色子数 > N,那么他就会重新摇色子. 走到N这个位置的话,意味着游戏结束了. 问游戏结束时,这个人得到金币的期望. 思路:这里给出两种做法,一种是正序求解,一种是逆序求解. ①正序求解: 这种做法是从前往后计算每个格子的概率,假设我们现在处于第…