Data Structure problem (SPOJ PATULJCI — Snow White and the N dwarfs)

Revision en1, by Tobby_And_Friends, 2017-01-12 04:28:59

Problem link: http://www.spoj.com/problems/PATULJCI/

Solution link: http://ideone.com/NqSI3j

Verdict: TLE

I tried to use Mo's algorithm and segment tree to solve the problem. How do I further optimize my solution? Any help is really appreciated.

Tags spoj, segment tree, mos_algorithm

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Tobby_And_Friends 2017-01-12 04:28:59 325 Initial revision (published)