Processing math: 100%
Subarray sum - MarisaOJ: Marisa Online Judge

Subarray sum

Time limit: 1000 ms
Memory limit: 256 MB
Given an array A of length n consisting of integers. Count the number of contiguous subsequences with a sum equal to x. ### Input - The first line contains two integers, n and x. - The second line contains n integers Ai. ### Output - Print the number of subsequences that satisfy the condition. ### Constraints - 1≤n≤105. - −109≤Ai,x≤109. ### Example Input: 4514-55 Output: 3