[LOJ 1027] Dangerous Maze】的更多相关文章

A - A Dangerous Maze Time Limit:2000MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu Description 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…
你在迷宫中;开始时在你面前看到n扇门.你可以选择你喜欢的任何门.所有门的选择门的概率是相等的. 如果您选择第i个门,它可以让您回到您在xi(xi小于0)分钟内开始的相同位置,也可以在xi(xi大于0)分钟后将您带出迷宫 第一行输入t,代表t个样例,第二行输入一个n,代表这个样例有多少扇门,第三行输入n个数字,如果是正数,那么在经过xi的时间后 你可以离开迷宫,如果xi是负数,那么在|xi|的时间后你又会会到原点,问你离开迷宫的期望是多少. 假设我们离开迷宫的期望是E,如果我们选择xi为正数的门,…
题目链接: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…
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 probability for choosing a door is equal for all…
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 door, it can either take you back to the same positio…
A Dangerous Maze (II) LightOJ - 1395(概率dp) 这题是Light Oj 1027的加强版,1027那道是无记忆的. 题意: 有n扇门,每次你可以选择其中一扇.xi为负值的门带你abs(xi)后又回到原点.xi为正值 的门则带你离开迷宫,并且你会记住你前面选择的K道门,在下次选择的时候不会选择这些门.选择每扇门的概率相等.求走出迷宫的时间期望值. 题解: \(定义E[i] 表示记住了K道门后,显然这K道门都是为负值的门,走出迷宫的时间期望值,sum1表示为正的…
题目链接:https://vjudge.net/problem/LightOJ-1395 1395 - A Dangerous Maze (II)    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.…
http://www.lightoj.com/volume_showproblem.php?problem=1027 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 door, it ca…
题目链接:http://www.lightoj.com/volume_showproblem.php?problem=1027 题目大意: 一个迷宫, 有n个门,选择一个门花费为|ai|, 如果选择的门是正数, 那么直接走出迷宫, 否则重新回到起始位置.选择每一道门的概率是一样的.求走出迷宫的花费的期望. 解题思路:n个门中正数的门有s个, 那么一次选择出去的概率为s/n, 那么出去需要次数的期望为n/s. 对于每一次选择, 需要花费的平均时间为sum(|ai|)/n, 那么走出迷宫的花费的期望…
题目链接:http://lightoj.com/volume_showproblem.php?problem=1027 题意:又一个迷宫,有n个门,每个门又一个值num,如果num>0 说明在num分钟后,可以走出迷宫,如果小于0说明要花费|num|分钟走到原点:已知到每个门的概率是一样的: 求能走出门时间的期望: 思路: 首先如果全是负数肯定是inf; 然后我们假设我们走出去的期望时间是 d; 那么拿第三个样例举例子; d = 1/3 * 3  + 1/3( 6 + d) + 1/3 (9 +…