题目大意:用1*2的砖头建n*2的墙,问有多少种不同的砖头排列方式?与斐波那契序列相似。

 #include <cstdio>
#define MAXN 60
#define N 50 unsigned int F[MAXN]; int main()
{
#ifdef LOCAL
freopen("in", "r", stdin);
#endif
F[] = ;
F[] = ;
for (int i = ; i <= N; i++)
F[i] = F[i-] + F[i-];
int n;
while (scanf("%d", &n) && n)
printf("%u\n", F[n]);
return ;
}

UVa 900 - Brick Wall Patterns的更多相关文章

  1. [LeetCode] Brick Wall 砖头墙壁

    There is a brick wall in front of you. The wall is rectangular and has several rows of bricks. The b ...

  2. [Swift]LeetCode554. 砖墙 | Brick Wall

    There is a brick wall in front of you. The wall is rectangular and has several rows of bricks. The b ...

  3. 554. Brick Wall最少的穿墙个数

    [抄题]: There is a brick wall in front of you. The wall is rectangular and has several rows of bricks. ...

  4. [LeetCode] 554. Brick Wall 砖头墙壁

    There is a brick wall in front of you. The wall is rectangular and has several rows of bricks. The b ...

  5. 【LeetCode】554. Brick Wall 解题报告(Python)

    [LeetCode]554. Brick Wall 解题报告(Python) 标签(空格分隔): LeetCode 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fux ...

  6. UVa 10384 - The Wall Pushers

    链接: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem& ...

  7. UVa 11587 - Brick Game

    称号:背景:brick game有N块,给你一个整数的定数S,两个人轮流木: 的木块数是集合S中存在的随意数字.取走最后木块的人获胜.无法取则对方获胜. 题干:如今让你先取,给你一个你的结果序列串T, ...

  8. UVa Live 4670 Dominating Patterns - Aho-Corasick自动机

    题目传送门 快速的通道I 快速的通道II 题目大意 给定一堆短串,和一个文本串,问哪些短串在文本串中出现的次数最多. 我觉得刘汝佳的做法,时间复杂度有问题.只是似乎这道题短串串长太短不好卡.比如给出的 ...

  9. 554. Brick Wall

    class Solution { public: int leastBricks(vector<vector<int>>& wall) { unordered_map& ...

随机推荐

  1. mapreduce 依赖组合

    mport java.io.IOException;import java.util.StringTokenizer; import org.apache.hadoop.conf.Configurat ...

  2. hadoop中联结不同来源数据

    装载自http://www.cnblogs.com/dandingyy/archive/2013/03/01/2938462.html 有时可能需要对来自不同源的数据进行综合分析: 如下例子: 有Cu ...

  3. 7--OC中NSLog函数输出格式详解

    OC中NSLog函数输出格式详解 • %@ 对象 • %d, %i 整数 • %u 无符整形 • %f 浮点/双字 • %x, %X 二进制整数 • %o 八进制整数 • %zu size_t • % ...

  4. POJ 3307 Smart Sister

    先找出所有的数,排序,然后o(1)效率询问 #include<cstdio> #include<cstring> #include<cmath> #include& ...

  5. Linux 监控文件事件

    某些应用程序需要对文件或者目录进行监控,来侦测其是否发生了某些事件.Linux很贴心的为我们提供了inotify API,也是Linux的专有. inotify API 在使用之前一定要有一个inot ...

  6. sqlserver2008用bat脚本备份时报错因为库名有中横杠【原创】

    提示原因是数据库名字有中横岗“-” 解决方法:用中括号把名字括起来就可以了 call :backupone [数据库名-new] 完整备份脚本如下 @ECHO ON set DATE=%date:/= ...

  7. Ubuntu14.04下SP_Flash_Tool_exe_Linux无法烧录

    1,用命令lsusb查看usb信息. 2,vim 20-mm-blacklist-mtk.rules 输入下面内容: ATTRS{idVendor}=="0e8d",ENV{ID_ ...

  8. linux dmesg命令

    linux dmesg命令详解   功能说明:显示开机信息. 语 法:dmesg [-cn][-s ] 补充说明:kernel会将开机信息存储在ring buffer,若是开机时来不及查看信息,可利用 ...

  9. 生成Token字符串

    生成比较短的Token字符串 有的时候,我们需要生成一些Token作为标识:如认证后的标识符,资源的提取码等.一个比较常见的算法是生成一个GUID来作为Token,由于GUID的随机性和唯一性特点,作 ...

  10. Vacations

    Vacations Vasya has n days of vacations! So he decided to improve his IT skills and do sport. Vasya ...