TLE in Min Query I

Do I need to use the lazy propagation technique in this question ,although this question seems to as a straightforward segment tree question ?

code link

its a single point update , so there is no use of lazy propagation,
lazy propagation is used when there is range update

So why is this code getting a TLE

sorry I forgot to attach gist…I have done it now
now can you help me?

@Saurabh-Kumar-1331476656958199 can you help…


you can watch my segment tree class , it would never give a tle

yours is giving tle because you are passing the vector agaian and again , just initialise it once

1 Like