Problem: [USACO][1]
Solution: [Contest Results][2]
In the solution for this problem, I am confused as to what L, R, mp, and lft do in the program. My current thoughts are:
L: Maintains cumulative sum for each individual array
R: The index where a particular cumulative sum for a certain array was last seen
lft: Completely lost…
mp: Completely lost… What is the point of mp if only mp[L] is modified? Why is mp[L] incremented?
In addition, if my thoughts on L and R are correct, why are the indices set to i+1 instead of i?
Please help, and thanks in advance!
vmaddur
[1]: USACO
[2]: Contest Results