NKMARS spoj — Help!

Revision en1, by 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).

Tags geometry, segment tree

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English eddycael 2015-12-19 20:42:14 595 Initial revision (published)