Few cases TLE,Few wrong only one case Passed

code Link : https://ide.codingblocks.com/s/221890

Problem Fibonacci meets GCD (Segment trees).I have gone through the hint video.

Hey @alampallyvinith buddy
So 2 things

  1. Line 58 why are you updating tree values in the query function it seems like you just had to return value not update tree as well
  2. For TLE while passing matrices to functions use reference variable
    You can also get rid of matrices, you can use integer based logarithmic approach to find FIBs. You can check out GFG to find that approach. It is at the very bottom.
1 Like

Thanks @Aarnav-Jindal-1059677350830863 it passed.The update thing I wrote it unknowingly,my bad.

1 Like