A Query Problem.

Правка en1, от dreamplay, 2018-03-06 23:04:28

Hey there.

I have the following problem, not from any ongoing or past contest. Can you help me, by suggesting what optimal methods you have to solve it.

Node has three properties: left, right, height

N Insert node queries. Each query is (l, r, h).

Now M queries ask following: L, R, H
For all nodes(l, r, h), that satisfy L <= l && r <= R,
return min( abs( H — h) )

Can you guys suggest some approaches that you have in mind?

Теги #data structure, #algorithms, #doubt, complexity optimization

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский dreamplay 2018-03-06 23:04:28 478 Initial revision (published)