Working on 1-d coordinate.

Правка en2, от stould, 2016-04-12 22:00:11

Hello community. I'll show the following statement:

Given N segments [Li, Ri] and Q queries Xi. Each query will ask if the Xi is inside some segment.

0 ≤ Li, Ri ≤ 109

Will at most 105 segments and at most 105 queries.

I have solved this problem sorting the segments, sorting the queries, and finally T(N+Q) processing. I am thinking now, if is it possible to be solved faster?.. But nothing comes to me.

Do you know something faster ?

Теги sorting, binary search tree

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский stould 2016-04-12 22:00:11 124
en1 Английский stould 2016-04-12 21:11:14 440 Initial revision (published)