POJ2663 Tri Tiling】的更多相关文章

思路: 设a[i]为N=i时的方法数.i为奇数的时候肯定为0. 如果i为偶数,a[i]可以看成a[i-2]加上两个单位组成的,此时多出来的2单位有3种方法. 也可以看成a[i-4]加上四个单位组成的,此时这四个单位一定是连在一起的,中间不能分割,所以只有两种放法. 同理,可看成a[i-6]加上六个单位组成的,此时这六个单位也连在一起,不能分割,只有两种放法. 直到所有的砖块都是连在一起的,中间不能分割,也只有两种放法. 所以 a[i]=3a[i-2]+2(a[i-4]+a[i-6]+-+a[0]…
Tri Tiling Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1631    Accepted Submission(s): 928 Problem DescriptionIn how many ways can you tile a 3xn rectangle with 2x1 dominoes? Here is a sampl…
Tri Tiling Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2731    Accepted Submission(s): 1547 Problem Description In how many ways can you tile a 3xn rectangle with 2x1 dominoes? Here is a sam…
                                                                                Tri Tiling   Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 10306   Accepted: 5237 Description In how many ways can you tile a 3xn rectangle with 2x1 domino…
题目链接:uva 10918 - Tri Tiling 题目大意:给出n,计算用1*2的瓷砖有多少种方法铺满3*n的地方. 解题思路:和uva 10359 - Tiling有点相似,不过难度会比较大,公式c[i] = 4 * c[i - 2] - c[i - 4]. 推导过程:c[0] = 1, c[2] = 3, c[4] = c[2] * 3 + c[1] * 2, c[6] = c[4] * 3 + (c[0] + c[2]) * 2 .... 即c[i] = c[i - 2] * 3 +…
Tri Tiling Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7841   Accepted: 4113 Description In how many ways can you tile a 3xn rectangle with 2x1 dominoes? Here is a sample tiling of a 3x12 rectangle.  Input Input consists of several t…
链接:http://acm.hdu.edu.cn/showproblem.php? pid=1143 Tri Tiling Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 2799 Accepted Submission(s): 1585 Problem Description In how many ways can you tile a…
Tri Tiling Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 2118    Accepted Submission(s): 1211 Problem Description In how many ways can you tile a 3xn rectangle with 2x1 dominoes? Here is a sa…
  Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Submit Status #include<cstdio> using namespace std; int f(int n) { ) ; ) ; else *f(n-)-f(n-); } int main() { int n; &&n!=-) ==) printf("%d\n",f(n));…
Description In how many ways can you tile a 3xn rectangle with 2x1 dominoes?  Here is a sample tiling of a 3x12 rectangle. Input Input consists of several test cases followed by a line containing -1. Each test case is a line containing an integer 0 <…