ramkanaam's blog

By ramkanaam, history, 9 years ago, In English

Sample problem

We have an imaginary array of size 10^18. And we are given Q queries (Q <= 100000), of the following type

1) increment (l, r, t) : Increase the numbers in the range [l, r] by t.

2) report(l, r) : Report the sum of numbers between [l, r];

How to solve such classes of problems? I have an intuition that we need to bother about indexes, which are used in Queries and no other points. So, I think the solution has to be offline. But, I can't formalize the approach. Can anyone help?.

Full text and comments »

  • Vote: I like it
  • -1
  • Vote: I do not like it