Tehran 2015 — Help with Billboard problem

Revision en1, by Hailo, 2016-10-17 19:06:57

Hi, could someone help me solving the following problem? LINK

I've tried 2 solutions, one with complexity O(N^3 logN) using two mutlisets and other O(N^3 log^2N) using a BIT (I have the test cases and seams that this second solution runs faster). I got TLE with both approaches, so I came here to ask help. Hope someone could give me a better solution.

Thanks

Tags tehran, data structure

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Hailo 2016-10-17 19:06:57 533 Initial revision (published)