hello 2018 的题目好棒棒啊 题意: 给定一个竞赛图, 对于 有的概率, 对于一个强连通分量内的点需要 […]
题面 题意： 给定n个长度为m的字符串，你每次都有等同概率去猜一个没有猜过的字符以及位置， 如果可以通过猜的信 […]
YYF is a couragous scout. Now he is on a dangerous mission which is to penetrate into the enemy's base. After overcoming a series difficulties, YYF is now at the start of enemy's famous "mine road". This is a very long road, on which there are numbers of mines. At first, YYF is at step one. For each step after that, YYF will walk one step with a probability of p, or jump two step with a probality of 1- p. Here is the task, given the place of each mine, please calculate the probality that YYF can go through the "mine road" safely.
The input contains many test cases ended with EOF.
Each test case contains two lines.
The First line of each test case is N (1 ≤ N ≤ 10) and p (0.25 ≤ p ≤ 0.75) seperated by a single blank, standing for the number of mines and the probability to walk one step.
The Second line of each test case is N integer standing for the place of N mines. Each integer is in the range of [1, 100000000].
For each test case, output the probabilty in a single line with the precision to 7 digits after the decimal point.
简单讲一下题目的意思吧 给定一个人在路上行走 […]