Count the most common occurrence of subarray sum.

Правка en3, от Loserinlife, 2023-06-03 14:16:36

Count the most common occurrence of subarray sum.

Constraints:

N <= 1e6; abs(ai) <= 1e6

Ex:

Inp:

5

1 1 2 1 4

Out:

3 (there are 3 subarray with the sum of 4: (1, 1, 2), (1, 2, 1), (4)

This question appears in ones of my friends competition and I have no idea how to solve it. Can someone help? Thanks.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский Loserinlife 2023-06-03 14:16:36 2 Tiny change: 'np:\n\n5\n1 1 2 1 ' -> 'np:\n\n5\n\n1 1 2 1 '
en2 Английский Loserinlife 2023-06-03 14:16:15 11
en1 Английский Loserinlife 2023-06-03 14:15:17 367 Initial revision (published)