백준 21909 / C++
https://www.acmicpc.net/problem/21909 21909번: Divisible by 3 For an array $[b_1, b_2, \dots , b_m]$ of integers, let’s define its weight as the sum of pairwise products of its elements, namely as the sum of $b_ib_j$ over $1 \le i < j \le m$. You are given an array of $n$ integers $[a_1, a_2, \dots , a_n]$, and a www.acmicpc.net [ 풀이 ] 문제의 정의에 나온 weight는 식으로 정리하면, 1/2*{(a[l]+....+a[r])^2 - (a[l]^..
2022. 8. 1.