JDOJ1178:铺地板II
JDOJ1178:铺地板II
https://neooj.com/oldoj/problem.php?id=1178
题目描述
用1 x 1和2 x 2的磁砖不重叠地铺满N x 3的地板,共有多少种方案?
输入
读入一个数N。1<=N<=1000。
输出
将答案输出。由于结果可能很大,你只需要输出这个答案mod 12345的值。
样例输入
样例输出
#include<stdio.h>
int a[];
int main()
{
int n;
a[]=;
a[]=;
a[]=;
scanf("%d",&n);
for(int i=;i<=n;i++)
a[i]=(a[i-]+a[i-]*)%;
printf("%d",a[n]);
return ;
}
JDOJ1178:铺地板II的更多相关文章
- Leetcode 笔记 113 - Path Sum II
题目链接:Path Sum II | LeetCode OJ Given a binary tree and a sum, find all root-to-leaf paths where each ...
- Leetcode 笔记 117 - Populating Next Right Pointers in Each Node II
题目链接:Populating Next Right Pointers in Each Node II | LeetCode OJ Follow up for problem "Popula ...
- 函数式Android编程(II):Kotlin语言的集合操作
原文标题:Functional Android (II): Collection operations in Kotlin 原文链接:http://antonioleiva.com/collectio ...
- 统计分析中Type I Error与Type II Error的区别
统计分析中Type I Error与Type II Error的区别 在统计分析中,经常提到Type I Error和Type II Error.他们的基本概念是什么?有什么区别? 下面的表格显示 b ...
- hdu1032 Train Problem II (卡特兰数)
题意: 给你一个数n,表示有n辆火车,编号从1到n,入站,问你有多少种出站的可能. (题于文末) 知识点: ps:百度百科的卡特兰数讲的不错,注意看其参考的博客. 卡特兰数(Catalan):前 ...
- [LeetCode] Guess Number Higher or Lower II 猜数字大小之二
We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to gues ...
- [LeetCode] Number of Islands II 岛屿的数量之二
A 2d grid map of m rows and n columns is initially filled with water. We may perform an addLand oper ...
- [LeetCode] Palindrome Permutation II 回文全排列之二
Given a string s, return all the palindromic permutations (without duplicates) of it. Return an empt ...
- [LeetCode] Permutations II 全排列之二
Given a collection of numbers that might contain duplicates, return all possible unique permutations ...
随机推荐
- MySQL执行状态的查看与分析
当感觉mysql性能出现问题时,通常会先看下当前mysql的执行状态,使用 show processlist 来查看,例如: 其中state状态列信息非常重要,先看下各列含义,然后看下state常用状 ...
- 算法问题实战策略 WORDCHAIN
地址 https://algospot.com/judge/problem/read/WORDCHAIN 解答: 1 书上的解法是制作有向图 然后查找欧拉回路 代码实现稍后 假设一定存在欧拉路径的 ...
- 设计模式-FlyWeight(结构型模式) 针对 需要创建大量对象的情形,被共享的状态作为内部状态,不被共享的状态作为外部状态
以下代码来源: 设计模式精解-GoF 23种设计模式解析附C++实现源码 //Flyweight.h #pragma once #include<string> class FlyWeig ...
- 【洛谷5335】[THUSC2016] 补退选(指针实现Trie)
点此看题面 大致题意: 三种操作:加入一个字符串,删除一个字符串,求最早什么时候以某个字符串为前缀的字符串个数超过给定值. \(Trie\) 这道题显然是\(Trie\)的暴力裸题. 考虑我们对于\( ...
- 掌握Spring REST TypeScript生成器
在优锐课的java分享中,讨论了关于Spring REST TypeScript生成器,该生成器创建反映后端模型和REST服务的模型和服务.码了很多干货,分享给大家参考学习. 我注意到网络开发人员创建 ...
- 大话设计模式Python实现- 享元模式
享元模式(Flyweight Pattern):运用共享技术有效地支持大量细粒度的对象. 下面是一个享元模式的demo: #!/usr/bin/env python # -*- coding:utf- ...
- MySQL基础之自连接用法简介
MySQL系列之自连接简介,MySQL自连接操作,没有特定的关键字,所谓自连接指的是同一个表不同实例之间的join操作 引用https://www.w3resource.com的图示: 特征: 自连接 ...
- RadioButtonList
RadioButtonList <asp:Label ID="txt_Gender" runat="server" Text="性别" ...
- linux远程执行ssh禁用交互方法
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ${user}@${ip} ${cmd}
- 使用 FiddlerCore 自定义 HTTP/HTTPS 网络代理
Fiddler 是个很好用的网络请求查看与调试工具,还可以写插件来扩展其功能. Fiddler 插件开发,使用 WPF 作为 UI 控件 - J.晒太阳的猫 - 博客园 但部分场景下,需要自定义很多网 ...