sudama_bera

difference array with D

Jul 17th, 2026
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.14 KB | Software | 0 0
  1. for normal : diff[start]++ and diff[end + 1]--.
  2. For jumping sequences: diff[D][A]++ and[D][A + L*D]--
  3. for each D : diff[D][i] += diff[D][i - D]
Advertisement
Add Comment
Please, Sign In to add comment