My code is giving tle despite not using call by value. https://ide.codingblocks.com/s/261128
Please help
My code is giving tle despite not using call by value. https://ide.codingblocks.com/s/261128
Please help
Hey @ayusdas2000 , The logic of the code is correct but it is slow time complexity wise .
If you know how to use segement trees try to do it using that . It will have a better time complexity and hence the testcase should pass
Thankyou
i am also using segment trees here,
i checked ur code.it is passing one test case.
both logically as well as implementation wise it is correct.
one change that i can suggest for improvement is instead of overloading * operator try to perform multiplication on ur own using loop. this will reduce that extra function call time .
even if it gives tle then try to use 4 variables or array in place of vector.
u can check this for reference ->