Блог пользователя om1429888

Автор om1429888, история, 22 месяца назад, По-английски

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?

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
22 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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