I stumble on this question (https://atcoder.jp/contests/abc116/tasks/abc116_c) and I cannot for my life understand what the problem ask me to solve
So I understand these part: we have N flowers each flowers start at 0 heights we have sequences of heights that map to each flowers. I know there could be some sort of addition in here because on the third sample, I can see 96+50+75 = 221.
What I didn't understand what is the relation of these "l" and "r" to the problem? I know r should be equal to the number of flower but in the first output, "r" can be 3.
I just cannot understand the problem, even after looking up the answer, I still don't know why the answer like that.
The $l$ and $r$ are indices. The input $(1,3)$ indicates that flowers number $1,2,3$ should be increased by $1$. If I instead input $(5,19)$, then flowers $5$ to $19$ are increased by $1$. So $r$ is not the number of flowers. Instead, if there are $n$ flowers, then we have to have $1 \leq l \leq r \leq n$.