I am getting TLE in UPDATEIT can anyone help to figure out what is wrong my code. Here is the link.
You don’t require segment tree or lazy propagation for such problem . It can be solved using prefix sum. Here is my
[1] :)
[1]: https://ideone.com/aMbZsD
I don’t code in JAVA, so not sure you’ve used the Fastest I/O, but there’s lots of comments there that without the fastest I/O, you will get TLE
using wrong algo would take more time and hence maybe its TLE…
okay then u must me missing something…
r u sure they did it in java ? cuz java is slow