CHFRAN please help figure out why just one test file keeps failing

Someone please help me understand what is wrong with my solution, why just one test in the first subtask file keeps failing all the time: https://www.codechef.com/viewsolution/28300857

I got 90pts but couldn’t make it 100.

I have just created partitions of the set of ranges based on overlap and keep track of the number of active (open) ranges which have not ended yet. Also keeping track of the previous_active and previous_to_previous_active values.

This helps to find the local (as well as global) minima of the active variable.

1 Like