Advertisement
GeeckoDev

Untitled

Aug 14th, 2012
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. int count_tilings ( int N,int M ) {
  2.     int count = 1;
  3.     int i, j;
  4.    
  5.     for (i=0; i<=M-2; i++)
  6.     {
  7.         for (j=0; j<=N-2; j++)
  8.         {
  9.             count ++;
  10.             count += count_tilings(N-j-2, M) - 1;
  11.             count += count_tilings(N, M-i-2) - 1;
  12.             count -= count_tilings(N-j-2, M-i-2) - 1;
  13.         }
  14.     }
  15.  
  16.     return count;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement