Need help on a manhattan distance problem

Revision en1, by mjguru, 2017-04-21 16:44:07

You are given a grid square of size R x H (R & H <= 10^9). You are also given N points (N <= 5000). Each point has a power R (R <= 10^9) associated with it. Each of these points can influence all points within a manhattan distance of R. Find out how many points are net influenced in the grid.

I thought about some sort of coordinate compression + Line Sweep algorithm + dp but could not get it through. I also tried converting points into x + y & x — y + coordinate compression + BIT but could not get any ideas. Please help. I am so stuck! Thanks in advance.

Tags manhattan distance, dp, line sweep

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English mjguru 2017-04-21 19:38:57 74
en3 English mjguru 2017-04-21 16:47:09 145
en2 English mjguru 2017-04-21 16:44:57 18
en1 English mjguru 2017-04-21 16:44:07 610 Initial revision (published)