Matrix exponentiation seq spoj

after generarting transformation matrix successfully while returning the result for given n , why dont we multiply the last row which actually contains the coefficients (or did in starting) with given base matrix , and then return because fn also is in last (in left hand side ).

you can try implementing your way and submit the code here;
https://hack.codingblocks.com/contests/c/547/829

after trying everything i could possibly do my solution doesn’t seem to pass more than one testcase.

1 Like

i was hoping to find someone who has gone through this problem and wont mind looking at my code and tell me where did i do wrong.

first of all , you dont have a doubt here, you are just suggesting something, secondly you have not posted a code here.

which you wanted someone to debug who has done the question

i was not suggesting i was just telling that i didn’t get some of that approach ,which i do consider as a doubt. And that has been solved anyway.