UVa 900 - Brick Wall Patterns
题目大意:用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的更多相关文章
- [LeetCode] Brick Wall 砖头墙壁
There is a brick wall in front of you. The wall is rectangular and has several rows of bricks. The b ...
- [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 ...
- 554. Brick Wall最少的穿墙个数
[抄题]: There is a brick wall in front of you. The wall is rectangular and has several rows of bricks. ...
- [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 ...
- 【LeetCode】554. Brick Wall 解题报告(Python)
[LeetCode]554. Brick Wall 解题报告(Python) 标签(空格分隔): LeetCode 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fux ...
- UVa 10384 - The Wall Pushers
链接: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem& ...
- UVa 11587 - Brick Game
称号:背景:brick game有N块,给你一个整数的定数S,两个人轮流木: 的木块数是集合S中存在的随意数字.取走最后木块的人获胜.无法取则对方获胜. 题干:如今让你先取,给你一个你的结果序列串T, ...
- UVa Live 4670 Dominating Patterns - Aho-Corasick自动机
题目传送门 快速的通道I 快速的通道II 题目大意 给定一堆短串,和一个文本串,问哪些短串在文本串中出现的次数最多. 我觉得刘汝佳的做法,时间复杂度有问题.只是似乎这道题短串串长太短不好卡.比如给出的 ...
- 554. Brick Wall
class Solution { public: int leastBricks(vector<vector<int>>& wall) { unordered_map& ...
随机推荐
- HDU1253--胜利大逃亡--HDU1240--Asteroids!--简单三维BFS
胜利大逃亡 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Subm ...
- Linux学习 -- Shell基础 -- Bash变量
变量 默认是字符串型,数值型需要显示指定 等号两侧都不能有空格 单引号:原始字符串 双引号:保留转义 命令结果作为值:反引号 或 $() 环境变量一般用大写 自定义变量 变量定义 name=& ...
- hdu_5718_Oracle(大数模拟)
题目连接:hdu_5718_Oracle 题意: 给你一串数,让你分出两个正整数,使其和最大,若不能分出来就输出"Uncertain" 题解: 当时比赛的时候还天真的去搞大数模版, ...
- Effective C++笔记之Item49【了解new-handler的行为】
//---------------------------------------------------------// //------------------------------------ ...
- win7 系统保留分区 BCDedit
系统保留分区简介编辑 “系统保留”分区示意图 Windows Vista/7出于安全考虑,在新装Windows Vista/7系统过程中,如果利用光盘的分区工具给硬盘分区时,系统默认的将一部分(100 ...
- Exponential notation
Exponential notation You are given a positive decimal number x. Your task is to convert it to the &q ...
- 贝塞尔曲线 & CAShapeLayer & Stroke 动画 浅谈
转载自:http://46aae4d1e2371e4aa769798941cef698.devproxy.yunshipei.com/qiaoqiaoqiao2014/article/details/ ...
- HDU 4421 ZOJ 3656 Bit Magic
2-SAT,不要所有位置全部建好边再判断,那样会MLE的. 正解是,每一位建好边,就进行一次2-SAT. #include<cstdio> #include<cstring> ...
- 解决cookie 跨iframe
document.cookie = "name=caoyc;path=/"document.cookie = "age=13;path=/"//时间可以不要,但 ...
- 杀死进程kill和fuser
1 kill -9 id 2 不行的话使用 fuser -k -SIGHUP /opt/bre/cookiemapping/wsapi/123 fuser有一个特别的用法在于它可以一次杀死那 ...