ZOJ 3551 —— 概率DP
来源:互联网 发布:中银淘宝校园卡欠费 编辑:程序博客网 时间:2024/06/05 00:39
In 0th day, there are n-1 people and 1 bloodsucker. Every day, two and only two of them meet.
Nothing will happen if they are of the same species,
that is, a people meets a people or a bloodsucker meets a bloodsucker. Otherwise, people may
be transformed into bloodsucker with probability p. Sooner or later(D days), all people will be turned
into bloodsucker. Calculate the mathematical expectation of D.
Input
The number of test cases (T, T ≤ 100) is given in the first line of the input. Each case consists of
an integer n and a float number p (1 ≤ n < 100000, 0 < p ≤ 1, accurate to 3 digits after decimal point),
separated by spaces.
Output
For each case, you should output the expectation(3 digits after the decimal point) in a single line.
Sample Input
12 1
Sample Output
1.000
Author: WU, Yingxin
Contest: ZOJ Monthly, October 2011
- ZOJ 3551 —— 概率DP
- ZOJ 3551 Bloodsucker 概率DP
- [zoj 3551]Bloodsucker[概率DP]
- zoj 3551 Bloodsucker (概率dp)
- ZOJ 3551 Bloodsucker 概率DP
- zoj 3551 Bloodsucker 概率DP
- ZOJ 3551 Bloodsucker(概率DP)
- ZOJ 3551 Bloodsucker [概率DP]
- ZOJ 3551 Bloodsucker (概率DP)
- ZOJ 3551 Bloodsucker(概率dp啊 )
- zoj 3582 概率dp
- zoj 3299 概率dp
- ZOJ 3822 概率DP
- 概率dp ZOJ 3640
- zoj 3640 概率dp
- zoj 3822概率dp
- 概率dp ZOJ 3329
- zoj 3640 概率dp
- Java:bufferedReader.readLine()读取文件换行问题
- PHP连接mssql 2005 输出json并处理中文乱码方法
- IT人员升职必会的软技能
- OCP-1Z0-053-V12.02-241题
- 这样不科学呀
- ZOJ 3551 —— 概率DP
- 用VC++实现Console程序显示彩色文本
- Dwr3.0与struts2一起使用的方法步骤详解
- JSF组件之selectManyCheckbox默认default 勾选checked
- openssl 的RSA 非对称加密算法
- Spring IoC容器--入门 二
- 求两个数的最大公约数和最小公倍数
- 利用ASIHttp实现文件的下载、上传和网络状态的监控
- 产品经理