Problem in a segment tree question PSTRG

Revision en1, by jha_gaurav98, 2018-03-26 20:14:53

I was solving the question PSHTRG. Basically it is a segment tree problem. I stored 45 greatest elements of each range as the node in segment tree and then for each query I used these elements to find the answer. But my code is giving TLE. I think there is nothing wrong with the logic but I am not able to optimize the code. Please can someone help. Thanks in advance.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English jha_gaurav98 2018-03-26 20:14:53 529 Initial revision (published)