2016武汉科技大学邀请赛现场赛 E题
来源:互联网 发布:淘宝手机详情页装修 编辑:程序博客网 时间:2024/05/11 04:45
WAM
Time Limit: 1 Sec Memory Limit: 128 MB 64bit IO Format: %lldSubmitted: 24 Accepted: 12 Special Judge
[Submit][Status][Web Board]
Description
WAM is a fantastic game. It’s full name is WHAC-A-MOLE, but it is different from the usual one we played.
Open this APP, ZiP finds that only one mole hole on the screen, so at most one mole will appear at the same time. After clicking the start button, a mole will appear once after a while, but stays for a short time. So if ZiP does not concentrate himself in the game, he could not hit the mole.
Once ZiP hits the mole, he could get some score. He could get n points if it is the n-th time he hit the mole consecutively, etc. He could get 1+2+3=6 points after hitting a mole consecutively for 3 times. But he got 0 if he misses it.
We have , which is the possibility that ZiP could hit the mole.
Please calculate the exception score he could get after hitting M times.
Input
The first line of input contains the number of test case T(T<=1000) . The descriptions of the test cases follow:
Each of the test cases has a single line contains a integer M(0<=M<=1e5)and a real number p(0<=p<=1) .
Output
For each test case, output a line with a real number - the answer.
The checker program will consider your answer correct, if the absolute error or relative error is less than 1e-5.
Sample Input
31 010 11 0.5
Sample Output
0.00000055.0000000.500000
题意:给出n个点,以及每个点的概率,计算连续n个点的数学期望
题解:E(n)=1*p^n+2*p^(n-1)+...+n*p这个不用解释了吧
- 2016武汉科技大学邀请赛现场赛 E题
- 2016武汉科技大学邀请赛现场赛 L
- 2016武汉科技大学邀请赛现场赛 A题
- 2016武汉科技大学邀请赛现场赛 B题
- 2016武汉科技大学邀请赛现场赛 C题
- 2016武汉科技大学邀请赛现场赛 D题
- 2016武汉科技大学邀请赛现场赛 F题
- 2016武汉科技大学邀请赛现场赛 G题
- 2016年武汉科技大学邀请赛网络赛 E题
- 2016年武汉科技大学邀请赛网络赛 A题
- 2016年武汉科技大学邀请赛网络赛 B题
- 2016年武汉科技大学邀请赛网络赛 J题
- 2016年武汉科技大学邀请赛网络赛 D题
- 2016年武汉科技大学邀请赛网络赛 C题
- 2016年武汉科技大学邀请赛网络赛 F题
- 2016年武汉科技大学邀请赛网络赛 G题
- 2016年武汉科技大学邀请赛网络赛 H题
- 2016年武汉科技大学邀请赛网络赛 I题
- Image Retrieval paper list of Liang Zheng
- Java多线程编程(一):创建并运行Java线程
- hdu 3017 Treasure Division 折半枚举 + 双指针
- UINavigationBar 设置透明 和去掉返回按钮
- Java文件流 字节流和字符流
- 2016武汉科技大学邀请赛现场赛 E题
- Android Fragment 真正的完全解析(上)
- Android开发笔记之ListView实现网络图片的显示
- android中如何将下载的图片保存到手机SD(外部存储)卡中
- uva 10652(凸包)
- innobackupex恢复操作报错两例
- 移动端开发:使用jQuery Mobile还是Zepto
- OC字符串去除首字母,OC字符串去除-号
- SearchView--搜索框案例