NKMARS spoj — Help!

Правка en1, от eddycael, 2015-12-19 20:42:14

Hi. I tried to solve this problem: NKMARS . My aproach is: Use sweepline algorithm, sort the events in opening vertical segments and closing vertical segments. Then for each value of X, add the current area to the answer and update the current 'window' of active segments in Y coordinate(from the left to the right). I think that a Segment Tree with lazy propagation must be useful here. But I dont know what data I would save for a single node in the Segment Tree. Can anyone help me? thanks in advance (Sorry for my poor english).

Теги geometry, segment tree

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский eddycael 2015-12-19 20:42:14 595 Initial revision (published)