The number of ways of going from a cell to another

Revision en1, by Eddagdeg, 2019-02-04 14:07:45

Hello! There is a field n×m, and k of its cells are impassable walls. A robot is initially at the cell (1,1) (bottom left). The robot can only move right or up, and eventually it needs to get into the cell (n,m), avoiding all obstacles. You need to count the number of ways he can do it. Assume that the sizes n and m are very large (say, 109), and the number k is small (around 100) how to solve that in o(k^3)? any hint please and thanks!

Tags #2d-dp, #combinatorics

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Eddagdeg 2019-02-04 14:07:45 494 Initial revision (published)