Problem with the hint discussed

Wont it will take O(n^3 log(T)) time to solve it if we solve it using approach discussed ,but n is given of order of 50000 so n^3=(5^4)*(10^12) producing TLE? or is it in question n is given wrong?

(5^3)*(10^12) instead

Hey @chhabrapiyush480
This question is not based on Matrix exponentiation
It is more based on logic, please try to think of the pattern at each iteration

Can you tell me that approach ,(the pattern which i got has time complexity O(T) which will also give TLE)?

@chhabrapiyush480

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

aarnav jindal ,your sent by you is of some other problem

this is another question

provide me the solution for it,you shared wrong link ,please read the problem and then try to answer it ,you just blindly googled it.

@chhabrapiyush480

i cant see your reply over here,but i got mail for it,and i am sorry for unproffesional kind of behaviour ,if any from my side.

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.