lately I starting studying segment tree in the EDU section
there are some problem to practice that the introducer didnt solve and leave it as exercises
I tried to solve this one but unfortunately the result was (time limit exceeded)
can you help me solving this problem or tell me what is the problem in my solution
this is the problem
and this is my solution My Solution
Edit: Unfortunately, it seems that I cannot point to the solution and the problem because it is in the member section so I will put them as links
Returning a 2d vector multiple times in a recursive function causes your code to TLE. You can either use 4 integers to represent the 2x2 matrix (which was what I did) or implement iterative segment tree (too lazy to implement it but I guess it should work). Click here to view my accepted code.