I’m looking back at my solution for Mountains, and I’m having a hard time figuring out why my solution involving lazy segment trees is so slow.
It should meet the time complexity; is the constant factor really that bad for lazy segtrees?
I’m looking back at my solution for Mountains, and I’m having a hard time figuring out why my solution involving lazy segment trees is so slow.
It should meet the time complexity; is the constant factor really that bad for lazy segtrees?
Are you sure your code has the correct complexity? It looks like you’re binary searching while calling set_range
, which adds an extra log factor?
Would that impact the run time that much?
sure, if your program is within a factor of 10 of the time limit