题目链接: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…
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…
传送门: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…
题目链接: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…
题目链接 题意: 给一个文档, 这个文档由yes .no 组成, 共有s个byte, 共有n个yes.no. 假设yes的个数为yes_num, no的个数为no_num. 将这n个数进行排列, 对于每个排列, 将其右移一个结果, 并在最左端补上yes, 再将其与原排列进行对比, 看有多少个不同的. 计算所有排列中 不同结果的平均次数. 思路: 可能题意说的不是很清楚, 这里抽象一下, 将yes用1代替, no用0代替. 当n = 3, s = 7时, 也就是2个0 一个1, 有下面三种排列 1…
https://vjudge.net/problem/LightOJ-1030 题意: 在一个1×N的格子里,每个格子都有相应的金币数,走到相应格子的话,就会得到该格子的金币. 现在从1格子开始,每次摇骰子,他就前进几步,但有一种情况例外,如果当前位置+色子数 > N,那么他就会重新摇色子. 走到N这个位置的话,意味着游戏结束了. 问游戏结束时,这个人得到金币的期望. 思路:这里给出两种做法,一种是正序求解,一种是逆序求解. ①正序求解: 这种做法是从前往后计算每个格子的概率,假设我们现在处于第…
题目链接: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…
题目链接:https://vjudge.net/problem/LightOJ-1027 1027 - A Dangerous Maze    PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB You are in a maze; seeing n doors in front of you in beginning. You can choose any door you like. The p…