Data Structure Problem

Revision en1, by Matrix.code, 2015-07-05 20:39:28

I am trying to solve Uva -1136

Link : 1136

My Approach :

I am using A segment tree ,each containing Maximum Value of The range. For each box, I am finding The smallest index ,where I can load Star-ship , Then update

But ,Getting TLE , (Time Limit : 18s )

Please Suggest Any Faster Update Method

My code : Code

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Matrix.code 2015-07-05 20:39:28 498 Initial revision (published)