Advertisement

前缀计算——Stripe

阅读量:

Stripe

题面翻译

已知一个整数n,现存在n个数值为a[i]的元素,要求将该序列划分为两个非空子序列,并使得这两个子序列中所有元素的总和相等,试计算满足条件的划分方式数目。
1<=n<=10^5
a[i]的绝对值不超过10000

题目描述

Once Bob took a paper stripe of n squares (the height of the stripe is 1 square). In each square he wrote an integer number, possibly negative. He became interested in how many ways exist to cut this stripe into two pieces so that the sum of numbers from one piece is equal to the sum of numbers from the other piece, and each piece contains positive integer amount of squares. Would you help Bob solve this problem?

输入格式

The first input line c

全部评论 (0)

还没有任何评论哟~