题目大意:用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. android 垂直 SeekBar 源代码(VerticalSeekBar)[转]

    主要是继承 AbsSeekBar 然后修改下面这些方法 onProgressRefresh() //当进度条数据更新的时候,例如我们拖动滑动条的时候,这个方法被调用 setThumbPos() //这 ...

  2. VirtualBox 复制vdi文件和修改vdi的uuid

    1.复制vdi文件:VBoxManage clonehd 因为VirtualBox不允许注册重复的uuid,而每个vdi文件都有一个唯一的uuid.所以要想拷贝一份vdi文件再次在VBOX中注册,简单 ...

  3. SQL查询重复记录

    假设现有一张人员表(表名:Person),若想将姓名.身份证号.住址这三个字段完全相同的记录查找出来,使用 1: SELECT p1.* 2: FROM persons p1,persons p2 3 ...

  4. listView上拉刷新下拉加载

    xlistview_header.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLa ...

  5. ListView下拉刷新、上拉载入更多之封装改进

    在Android中ListView下拉刷新.上拉载入更多示例一文中,Maxwin兄给出的控件比较强大,前面有详细介绍,但是有个不足就是,里面使用了一些资源文件,包括图片,String,layout,这 ...

  6. Andriod学习笔记 - 参考

    Andriod学习笔记 - 参考 自定义实现圆形播放进度条(android,飞一般的感觉) 盘点Android开发者必备的十大开发工具

  7. Cocos2d-x V2.x -- 开发进阶和高级实例教程(一) 转

    第一章 如何在多平台新建Cocos2d-x项目 yangyong2014-06-25 15:04:44848 次阅读 原文链接:   http://cn.cocos2d-x.org/tutorial/ ...

  8. 读 《我为什么放弃Go语言》 有感

    最近又熟悉了下go语言,发现go语言还有许多设计不好的地方,然后又读到了<我为什么放弃Go语言>这篇文章, 对于某些方面,我还是比较认同的. 这篇文章总结了十六点,如下: 1.1 不允许左 ...

  9. for和getElementByTagName配合

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  10. hive第二篇----hive中partition如何使用

    一.背景 1.在Hive Select查询中一般会扫描整个表内容,会消耗很多时间做没必要的工作.有时候只需要扫描表中关心的一部分数据,因此建表时引入了partition概念. 2.分区表指的是在创建表 ...