题目大意:用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 ApplicationContext Context Activity 内存的一些学习

    Android中context可以作很多操作,但是最主要的功能是加载和访问资源. 在android中有两种context,一种是application context,一种是activity cont ...

  2. 免费vpn:SoftEther VPN

    Google it. 注意下载2.0版的,不要下载最新版的.

  3. CNS数据库网站只用mysql自带的fulltext index功能就可实现了。

    1)编辑脚本script.sql如下 ALTER TABLE `table_name` ADD FULLTEXT (`column_name`) 2)在mysql console下输入命令 SOURC ...

  4. Windows Server 2003 下如何安装及配置 FTP 服务器(转)

    Windows Server 2003 下如何安装及配置 FTP 服务器 一.安装 FTP 服务器组件: 写在这里的一点 : 安装及配置 FTP 服务器之前 , 必须先手工配置服务器本身的 IP 地址 ...

  5. mysql链接表,connection string, federated engine

    http://database.51cto.com/art/201011/234561.htm

  6. iOS原生refresh(UIRefreshControl)

    转载:http://www.2cto.com/kf/201504/392431.html // // ViewController.m // 代码自定义cell // // Created by ma ...

  7. oracle有三个默认的用户名和密码,但是都无法登录的解决方法

    system/change_on_install, system/manager是较旧版的预设密码, 在安装较新版时会提示你设定密码, 若没有或忘了设定, 请参考以下重设: sqlplus / as ...

  8. Puzzles

    Puzzles Barney lives in country USC (United States of Charzeh). USC has n cities numbered from 1 thr ...

  9. ExtJS的4.1新特性简要介绍

    ExtJS的4.1新特性简要介绍 一.动态加载机制 Ext.require动态加载任何类,并且会加载依赖类: 二.新类系统 •类定义:ExtJS4.0以后应入了Ext.define方法,他通过类的字符 ...

  10. Use View.isInEditMode() in your custom views to skip code when shown in Eclipse

    今天在做自定义ViewGroup中,出现了一下错误提示Use View.isInEditMode() in your custom views to skip code when shown in E ...