#d2868. 简单子段和
简单子段和
Simple Subarray Sum
Problem Description
You are given an integer array of length and an integer .
How many subarrays of have a sum exactly equal to ?
Input Format
The first line contains two integers and : the size of array and the given integer .
The second line contains integers giving the elements of the array.
Output Format
Output one integer: the answer.
Sample Input 1
6 5
8 -3 5 7 0 -4
Sample Output 1
3
There are three subarrays (, , and ) whose sum equals .
Sample Input 2
2 -1000000000000000
1000000000 -1000000000
Sample Output 2
0
Constraints
, , .