Help needed for SPOJ BUILDING — Buildings

Revision en1, by I__Love__TANIA, 2018-09-18 05:17:24

I need help to solve SPOJ — BUILDING

I can solve it in O( total h_i * 2 * log(m) ). But it is not enough to get Accepted.

How can i optimize complexity?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English I__Love__TANIA 2018-09-18 05:17:24 248 Initial revision (published)