om1429888's blog

By om1429888, history, 2 years ago, In English

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?

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Isn't it f(n) = (1-p)f(n-1) + p(1-f(n-1))?