Help In Problem 276C

Revision en1, by one0one, 2019-03-29 19:20:33

Hello, I tried segment tree with lazy propagation on this problem. Implementation is taken from this article. I got TLE on test#7.

In my opinion, my solution is nlog(n). updateRange works in log(n) time and I call it q times hence qlog(n). Then I call n times queryRange, it's runtime also log(n) hence nlog(n). Overall complexity is nlog(n) + qlog(n). It should work well in given constraints but unfortunately I got TLE.

So what I am missing?

Tags #segment tree, #lazy propagation, #range query

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English one0one 2019-03-29 19:20:33 608 Initial revision (published)