suggi_d_luffy's blog

By suggi_d_luffy, history, 10 years ago, In English

Off late I have been encountering problems which ask to solve me queries like: GCDQ

STRQ

How to tackle such problems.Are there good resources to study these topics.Please post links if there are any resources and suggest strategies.

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

| Write comment?
»
10 years ago, # |
  Vote: I like it 0 Vote: I do not like it

This is a huge class of problems and there are so many techniques for solving them, so really to learn them you just have to do a bunch of problems of that type. Here are a few ways to solve some problems of this form though: Cumulative sum arrays (pre-compute the sum of the first k elements for all k and store these in an array), Segment trees, Square root decomposition, Mo's algorithm