Need help for Codeforces 877F (Ann and Books)

Revision en1, by emrulhasan, 2023-09-29 09:55:03

https://codeforces.net/contest/877/problem/F

That is the problem. This problem is solved by MO. I have understood whole thing. But I couldn't understand while we are moving our pointer to the left we are counting the values for (+ k) and when we are moving our pointer to the right we are counting the values for (- k). Can anyone tell me why we are not counting the (- k) values while moving our pointer to the left and why we are not counting (+ k) values while we are moving our pointer to the right?

My question is when we are moving our pointer to the left we are supposed to add the value for + k and — k and for right pointer the same thing should be happened. Why we are not doing this?

Can anyone help me regarding this? Thank you

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English emrulhasan 2023-09-29 09:55:03 801 Initial revision (published)