提交时间:2024-08-20 15:14:58
运行 ID: 169102
#include "bits/stdc++.h" using namespace std; long long n,sum; vector <int>a(1001); signed main(){ cin >> n; for(int i=0;i<n;i++)cin >> a[i]; for(int i=0;i<n;i++)for(int j=i+1;j<n;j++)for(int k=j+1;k<n;k++)sum+=a[i]+a[j]+a[k]; cout << sum; return 0; }