Please subscribe to the official Codeforces channel in Telegram via the link: ×

rahul_1234's blog

By rahul_1234, history, 12 months ago, In English,

Can someone provide me segment tree implementation of:

Range update : Add x to range

Finding frequency of a constant in range

I know of solution in sqrt decomposition exist, but I wanted in terms of segment tree (maybe lazy propagation or policy based data structures)?

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

12 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Can someone provide me an understandable code for SQRT decomposition for the above if segment tree can't be provided?