Help In Problem 276C

Правка en1, от 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?

Теги #segment tree, #lazy propagation, #range query

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский one0one 2019-03-29 19:20:33 608 Initial revision (published)