zcmimi's blog
查看原题

点击跳转

#include<bits/stdc++.h>
using namespace std;
#define N 10011
int n;
int main(){
    double ans=0,a=0,b=0,x;
    scanf("%d",&n);
    while(n--){
        scanf("%lf",&x);
        ans=ans+x*(3*a+3*b+1);
        a=(a+b*2+1)*x;
        b=(b+1)*x;
    }
    printf("%.1f\n",ans);
}
LG 1654 OSU!
comment评论
Search
search