Hello Codeforces community!
Please help on this problem:
Given array with length N (1 ≤ N ≤ 105, 1 ≤ ai ≤ 109). And given Q queries(1 ≤ Q ≤ 105). For each query given one number X. (1 ≤ X ≤ 1014). Find number of subarrays which sum equals to X.
Sorry for my poor English.
i think there is no solution less than o(n2), as there is about o(n2) possible subarrays to count their sum
The thing is, we don't have to enumerate subarrays to get their sum. If you want the actual subarrays, then we cannot have a solution that is better than O(n^2)