Time limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others)
Total submission (s): 34709 Accepted Submission (s): 16840
Problem description in a rectangular square of 2xn, fill the squares with a 1x2 domino, enter N, and output the total number of paving schemes.
For example, when n=3, for 2x3 squares, the Domino placement scheme has three kinds, such as:
Input data consists of multiple lines, each containing an integer n, indicating that the size of the rectangular square of the test instance is 2xn (0<n<=50).
Output for each test instance, export the total number of tiling schemes, one row for each instance.
Sample Input
132
Sample Output
132
#include <stdio.h>
int main ()
{
int i,n,a;
__int64 x[55];
X[0]=1;
X[1]=1;
x[2]=2;
for (i=3;i<55;i++)
X[I]=X[I-1]+X[I-2];
while (scanf ("%d", &a)!=eof)
{
printf ("%i64d\n", X[a]);
}
return 0;
}
Dominoes Shop Squares