Debugging help on (similar to) a lca problem

Revision en3, by memeset, 2016-10-14 07:22:46

Hi everyone, I am getting a test case wrong for this problem and have already spent multiple days debugging. Could somebody please take a look at my code and help me find the bug?

A few things about the code: - an Event consists of an array of the lowest indexed people that are contained in a segment, in sorted order.

  • the array e[i][j] is the segment from vertex i to its 2^(j-1)th parent, inclusive, and stores events. e[i][0] is just that node's event, ie a segment with only itself.

  • dp[i][j] is the 2^jth parent of node i.

  • anc returns the kth ancestor of a vertex.

  • mergeevent merges two events' persons that are contained, while maintaining sorted order.

  • removeDup removes duplicates in the array.

Thanks everyone!

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English memeset 2016-10-14 07:22:46 12
en2 English memeset 2016-10-14 07:22:08 12
en1 English memeset 2016-10-14 07:21:30 830 Initial revision (published)