poj 2663 Tri Tiling--状压dp
2016-10-27 13:10
316 查看
原题链接:http://poj.org/problem?id=2663
题意:一个3*n的表格,用一个1*2的方块填充,在填满的情况下,一共多少种填充方式。
http://blog.csdn.net/qiqijianglu/article/details/8082042
http://blog.csdn.net/u010663294/article/details/34856033
#define _CRT_SECURE_NO_DEPRECATE
#include<iostream>
#include<vector>
#include<cstring>
#include<queue>
#include<stack>
#include<algorithm>
#include<cmath>
#include<string>
#include<stdio.h>
#define INF 99999999
#define eps 0.0001
using namespace std;
long long a[35];
int main()
{
int n;
a[0] = 1;
a[2] = 3;
for (int i = 4; i <= 30; i = i + 2)
a[i] = a[i - 2] * 4 - a[i - 4];
while (scanf("%d", &n) && (n != -1))
{
printf("%lld\n", a
);
}
return 0;
}
题意:一个3*n的表格,用一个1*2的方块填充,在填满的情况下,一共多少种填充方式。
http://blog.csdn.net/qiqijianglu/article/details/8082042
http://blog.csdn.net/u010663294/article/details/34856033
#define _CRT_SECURE_NO_DEPRECATE
#include<iostream>
#include<vector>
#include<cstring>
#include<queue>
#include<stack>
#include<algorithm>
#include<cmath>
#include<string>
#include<stdio.h>
#define INF 99999999
#define eps 0.0001
using namespace std;
long long a[35];
int main()
{
int n;
a[0] = 1;
a[2] = 3;
for (int i = 4; i <= 30; i = i + 2)
a[i] = a[i - 2] * 4 - a[i - 4];
while (scanf("%d", &n) && (n != -1))
{
printf("%lld\n", a
);
}
return 0;
}
相关文章推荐
- poj 2663 Tri Tiling 状压dp
- POJ 2411 + POJ 2663 + POJ 3420 小方格填充之多米诺骨牌系列(状压DP)
- poj 2663 Tri Tiling 【简单数位DP】
- POJ-2663,2506 Tri Tiling 递推 | 压缩DP
- 【POJ 2663】Tri Tiling(dp|递推)
- POJ3254 状压DP入门
- POJ 2663 Tri Tiling 线性递推 矩阵快速幂
- POJ 3254 Corn Fields(状压DP)
- Hie with the Pie - POJ 3311 状压dp
- Poj 3254 Corn Fields(状压DP)
- POJ 1185 炮兵阵地 状压dp
- POJ 3254 Corn Fields 状压DP
- POJ 3254 Corn Fields(状压dp)
- POJ 3254 Corn Fields(状压DP)
- 2017-07-04(状压DP:POJcorn field 3254)
- Best Sequence(poj 1699) 状压dp(TSP)
- POJ 2663 Tri Tiling(完美覆盖)
- POJ 3311 Hie with the Pie (状压DP)
- POJ 2663 Tri Tiling
- Mondriaan's Dream POJ - 2411 状压DP