om1429888's blog

By om1429888, history, 22 months ago, In English

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?

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

| Write comment?
»
22 months 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))?