Seg 2D problem: Query using manhattan distance[HELP]

Revision en2, by ThomazL, 2017-05-31 03:48:07

Hi guys,

Today i viewed a, aparently, simple seg2D problem:

SET x y d: Set position (x,y) of the grid to integer d.

QUERY x y d: Return the gcd (Greatest Common Divisor) of all positions of the grid that are at most 'd' positions away (Manhattan Distance) from position (x,y).

But a have no ideia to solve this query type '-'

Can someone help me?

Tags 2d segment tree, help, uri, advanced data structure

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English ThomazL 2017-05-31 04:43:42 2 Tiny change: ').\n\nBut a have no i' -> ').\n\nBut i have no i'
en2 English ThomazL 2017-05-31 03:48:07 3 Tiny change: 'teger d.\n**QUERY ' -> 'teger d.\n\n**QUERY '
en1 English ThomazL 2017-05-31 03:30:21 490 Initial revision (published)