CCO '15 P3 — Solar Flight: Segment Tree Problem With Geometry

Revision en3, by vamaddur, 2017-08-21 22:55:26

Problem Link

Source Code

Test Data

I tried to solve the problem above using a Segment Tree for each plane. The idea is that I find the maximum interference level between each pair of intersection points, and do a Range-Maximum-Query on the segments the query overlaps. It seems that I have the correct idea/complexity since my code passes the cases of Batch 2 (consisting of max case), but I WA on the Batch 1 Cases.

I think the error I have lies in how I determine the indices for querying in lines 98-120, but I have not been able to find/fix it. Where did I go wrong in solving the problem?

Please help, and thanks in advance!

EDIT: Bump? I would appreciate if someone commented what additional information they would need to help me out instead of relentlessly pushing the downvote button...

Tags segment tree, #geometry

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English vamaddur 2017-08-22 07:11:38 212
en3 English vamaddur 2017-08-21 22:55:26 169
en2 English vamaddur 2017-08-21 06:09:49 3 Tiny change: 'em/cco15p3\n\n[Sourc' -> 'em/cco15p3)\n\n[Sourc'
en1 English vamaddur 2017-08-21 06:09:24 846 Initial revision (published)