How to count simple cycles between cell (1,1) and cell (n,m) in a grid??

Revision en1, by AzorAhai, 2016-04-15 22:00:06

Hi guys, I was trying to solve this problem http://acm.timus.ru/problem.aspx?space=1&num=1459 obviously the solution is counting simple cycles between cell (1,1) and cell (n,m) in the given grid. but since m is very large I think that we need to use matrix power to solve this problem .. but I could't find any recurrence to use.. any help please?? thanks in advance.

Tags matrix power, dp

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English AzorAhai 2016-04-15 22:00:06 447 Initial revision (published)