
|
1
2
3
4
5
6
7
8
9
10
11
12
|
#include <bits/stdc++.h>typedef long long LL;using namespace std;int main() { int n; double a[100010]; double sum = 0; cin >> n; for(int i = 0; i < n; i++) scanf("%lf",&a[i]); for(int i = 0; i < n; i++) sum += a[i] * (n - i) * (i + 1); printf("%.2f
",sum);} |