#P1003. 序列子段和(d)
序列子段和(d)
Problem description
Given a sequence of length , you can add a positive or negative sign to any number to find the number of consecutive sub-segments with a sum of 0.
Input format
The first line contains (). The second line contains (), and the sum of the sequence is less than or equal to 10000.
Output format
Output the number of solutions modulo where the sum of consecutive sub-segments is 0.
4
1 1 1 1
12
相关
在下列比赛中: