Hi,↵
So this has happened before , and it happens from time to time , only this time I really got frustrated and hence am asking this question . .↵
Why is my segment tree so slow?↵
↵
Some problems like this -> [problem:301D] , have the official solution, the same as the solution that I code but somehow my segment tree is always very slow.↵
This has happened before in live contests as well . ↵
Maybe my implementation is very bad , that's why I want to learn where I am making mistake , and please provide me with a better implementation if I am making a mistake..↵
↵
My implementation to the above problem,using segment trees, which TLE's --> [submission:36075338] .↵
Help me out on this please!↵
↵
**UPDATE:** I solved the problem doing some minor optimizations like scanf/printf and using int instead of long long , but my solution is still very slow compared to other solutions..
So this has happened before , and it happens from time to time , only this time I really got frustrated and hence am asking this question . .↵
Why is my segment tree so slow?↵
↵
Some problems like this -> [problem:301D] , have the official solution, the same as the solution that I code but somehow my segment tree is always very slow.↵
This has happened before in live contests as well . ↵
Maybe my implementation is very bad , that's why I want to learn where I am making mistake , and please provide me with a better implementation if I am making a mistake..↵
↵
My implementation to the above problem,using segment trees, which TLE's --> [submission:36075338] .↵
Help me out on this please!↵
↵
**UPDATE:** I solved the problem doing some minor optimizations like scanf/printf and using int instead of long long , but my solution is still very slow compared to other solutions..