Dominoes Shop Squares
Time limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others) total submission (s): 42691 Accepted Submission (s): 20698
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 Input132
Sample Output132
Authorlcy
It is also a problem to find the law:
Application of the Fibonacci heat sequence ...
#include <iostream>using namespacestd;intMain () {intN; __int64 a[ -]; while(Cin >>N) {a[1] =1; a[2] =2; for(intj =3; J <= N; J + +) A[j]= A[j-1] + a[j-2]; cout<< A[n] <<Endl; } return 0;}
HDU Dynamic Programming L