2

help with this recurrence relation

 2 years ago
source link: http://codeforces.com/blog/entry/105560
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

https://codeforces.com/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?


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK