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

Автор Tobby_And_Friends, история, 7 лет назад, По-английски

I was trying this problem from SPOJ: http://www.spoj.com/problems/LVADER/en/. I figured out the recurrence for the problem which is f(x, y) = f(x — 1, y) + f(x, y — 1) + f(x — 1, y — 1), f(x, 0) = f(0, y) = 1. The constraints of the problem does not allow me to use normal DP and I'm not aware how to use matrix exponentiation technique for 2-D recurrence. I read this article: https://threads-iiith.quora.com/Solving-Dynamic-Programming-with-Matrix-Exponentiation but I could not fully understand the idea. Any help is really appreciated.

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

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

(We can always translate Luke's position to (0, 0).) Sorry if something is unclear, please clarify if needed.

With matrix exponentiation, you have a list of subsets of states, where the transitions between these states are (almost) the same. For instance, in the "find n-th Fibonacci number in O(logn)" problem, the 'subsets of states' are (Fn - 1, Fn) for positive n.

What could the subsets of states be?
What simple problem does this look like?
»
7 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Read up this — Delannoy Numbers. You don't need Matrix Exponentiation here.

»
6 лет назад, # |
  Проголосовать: нравится -14 Проголосовать: не нравится

Can anyone provide some standard tutorial/resources to learn it. I stuck on a task of october long challenge :(