#include<stdio.h>
/*n^2=2*C(2,n)+n*/
/*无耐没学过概率论,基本思想是既然得分公式同上,那么最后的期望可以把每个位置代入,进行计算*/
int main(void)
{
int n;
double temp,pre=0,ans=0;
scanf("%d",&n);
while(n--)
{
scanf("%lf",&temp);
pre*=temp;
ans+=2*pre+temp;
pre+=temp;
}
printf("%.15lf\n",ans);
return 0;
}
codeforces 235B - Let's Play Osu!
最新推荐文章于 2019-05-04 23:46:07 发布