分析:
代码:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define print(i) cout << "debug: " << i << endl
#define close() ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define mem(a, b) memset(a, b, sizeof(a))
#define pb(a) push_back(a)
#define x first
#define y second
typedef pair<int, int> pii;
const double eps = 1e-8;
const ll mod = 1e9 + 7;
const int maxn = 2e5 + 10;
const int inf = 0x3f3f3f3f;
int n;
int main()
{
cin >> n;
double x = 0, x2 = 0, ans = 0;
for(int i = 1; i <= n; i++)
{
double p; cin >> p;
ans += (3 * x2 + 3 * x + 1) * p;
x2 = (x2 + 2 * x + 1) * p;
x = (x + 1) * p;
}
printf("%.1f\n", ans);
}