help with this recurrence relation

Revision en1, by om1429888, 2022-08-03 17:51:23

https://codeforces.me/gym/102644/problem/A

for this problem i thought of the recurrence relation and then applied matrix exponentitation, my relation was (1-p)*f(n-1)+p*p*f(n-2);

why is this relation wrong?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English om1429888 2022-08-03 17:51:23 247 Initial revision (published)