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 $A_i$. ### Output - Print the number of subsequences that satisfy the condition. ### Constraints - $1 \le n \le 10^5$. - $-10^9 \le A_i, x \le 10^9$. ### Example Input: ``` 4 5 1 4 -5 5 ``` Output: ``` 3 ```