你有一个数组a[1],a[2],...,a[n],由n个整数组成。计算有多少种方法可以将数组中的所有元素分成三个连续的部分,使每个部分的元素之和相同。
更正式地说,你需要找到这样的索引对i,j(2≤i≤j≤n-1)的数量,即下图所示。
You've got array
a[1],a[2],...,a[n], consisting of
n integers. Count the number of ways to split all the elements of the array into three contiguous parts so that the sum of elements in each part is the same.
More formally, you need to find the number of such pairs of indices
i,j (2≤i≤j≤n-1), that
.