Random Sequence
Time Limit: 3000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 98Accepted Submission(s): 51
Problem Description
There is a random sequence L whose element are all random numbers either -1 or 1 with the same possibility. Now we define MAVS, the abbreviate of Maximum Absolute Value Subsequence, to be any (if more than one) subsequences of L whose
absolute value is maximum among all subsequences. Given the length of L, your task is to find the expectation of the absolute value of MAVS.
Input
There is only one input file. The first line is the number of test cases T. T positive integers follow, each of which contains one positive number not greater than 1500 denoted the length of L.
Output
For each test case, output the expectation you are required to calculate. Answers are rounded to 6 numbers after the decimal point.(as shown in the sample output)
Sample Input
Sample Output
Case 1: 1.000000
Case 2: 2.750000
Case 3: 4.167969
Source
我也不知道怎么做
反正是写了个暴力的程序,找规律过掉的。。嘿嘿
代码:
暴力的打表程序:
分享到:
相关推荐
杭电hdu acm资料所用杭电的acm题
hdu acm 教案 搜索入门 hdu acm 教案 搜索入门
hdu acm 教案 动态规划(1) hdu acm 教案 动态规划(1)
杭电 hdu acm 第1084题的解法,ac过了,是一位学长教我的.内有一些中文说明.
ACM HDU题目分类,我自己总结的大概只有十来个吧
自己做的HDU ACM已经AC的题目
hdu-acm源代码(上百题)hdu-acm源代码、hdu-acm源代码hdu-acm源代码
HDU_ACM培训课件(完整版) HDU_ACM培训课件(完整版) HDU_ACM培训课件(完整版) HDU_ACM培训课件(完整版)
杭电acm解题报告 详细解析2000-2099 适合acm初学者
经典算法:(二分匹配,背包专题,筛选法,简单数学题,贪心算法,递推求解,动态规划,并查集,母函数,搜索,组合博弈等入门算法)
杭电ACM课件2014版之 (HDUACM201303版_07)背包专题
此程序为hdu的acm2010题,就是解决水仙花数问题
acm 技术大牛 课件 HDU 自学必备课件 全套齐全 (lecture_01)初识ACM (lecture_02)简单数学题 (lecture_03)递推求解 (lecture_04)动态规划(1)_ (lecture_05)计算几何基础_ (lecture_06)母函数 (lecture_...
HDU的ACM,非常的好 涉及了很多算法,例如二分匹配、博弈、组合、最小生成树、搜索、动态规划、贪心算法
杭电ACMhdu1163
杭电ACM课件2014版之(HDUACM2010版_13)二分匹配及其应用
HDU 的ACM培训资料 共11课时 HDU 的ACM培训资料 共11课时
这是老师给我的哦,里面有完整版的HDU杭电ACM课件,还附有2000-2099的解题报告跟DP背包问题,如果你是acm的初学者,那么这是必须的,看了会有很大的帮助哦!
(HDUACM2010版_08)母函数(HDUACM2010版_08)母函数(HDUACM2010版_08)母函数(HDUACM2010版_08)母函数(HDUACM2010版_08)母函数(HDUACM2010版_08)母函数