Блог пользователя suggi_d_luffy

Автор suggi_d_luffy, история, 9 лет назад, По-английски

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.

  • Проголосовать: нравится
  • -6
  • Проголосовать: не нравится

»
9 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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