#include <iostream>
using namespace std;
int main(){
int n;
cin>> n;
int a[100000];
for (int i = 0;i < n;i++){
cin>> a[i];
}
long long weight = 0;
long long glue = 0;
for (int i = 0;i < n;i++){
glue = glue + weight * a[i];
weight = weight + a[i];
}
cout << glue;
return 0;
}
P8709 [蓝桥杯 2020 省 A1] 超级胶水
最新推荐文章于 2024-11-11 20:40:17 发布