对于一个序列\(a_x\),用\(o(n)\)的复杂度求\(\sum_\limits{i=1}^n\sum_\limits{j=i+1}^n a_i\times a_j\)
sum = 0;
for (int i = 1; i < n; i++) {
sum += a[i] * a[i - 1];
a[i] += a[i - 1];
}
灵感来自于[蓝桥杯 2020 省 A1] 超级胶水
标签:结论,limits,一个,sum,A1,复杂度,蓝桥 From: https://www.cnblogs.com/FrankOu/p/17024047.html