JDOJ3011 铺地板III
JDOJ3011 铺地板III
https://neooj.com/oldoj/problem.php?id=3011
题目描述
有3 x N (0 <= N <= 105)的网格,需要用1 x 2的瓷砖铺满。
问有多少种铺设方案。
如图,是一个3 x 12的一种铺设方案。



输入
输入一个整数N,表示是一个3 x N的网格。
输出
输出一个整数,表示铺设方案总数,答案可能会很大,结果模上2333333。
样例输入
样例输出
#include<bits/stdc++.h>
int f[];
int main()
{
int n;
scanf("%d",&n);
f[]=;
f[]=;
f[]=;
f[]=;
if(n%!=)
{
printf("");
}
else
{
for(int i=;i<=n;i++)
{
if(i%==)
f[i]=(f[i-]+f[i-])%;
else
f[i]=(f[i-]*+f[i-])%;
}
printf("%d",f[n]);
}
return ;
}
JDOJ3011 铺地板III的更多相关文章
- 用Kotlin开发Android应用(III):扩展函数和默认值
这是关于Kotlin的第三篇. 原文标题:Kotlin for Android (III): Extension functions and default values 原文链接:http://an ...
- LeetCode Single Number I / II / III
[1]LeetCode 136 Single Number 题意:奇数个数,其中除了一个数只出现一次外,其他数都是成对出现,比如1,2,2,3,3...,求出该单个数. 解法:容易想到异或的性质,两个 ...
- SPOJ GSS3 Can you answer these queries III[线段树]
SPOJ - GSS3 Can you answer these queries III Description You are given a sequence A of N (N <= 50 ...
- 【Codeforces717F】Heroes of Making Magic III 线段树 + 找规律
F. Heroes of Making Magic III time limit per test:3 seconds memory limit per test:256 megabytes inpu ...
- LeetCode——Best Time to Buy and Sell Stock III (股票买卖时机问题3)
问题: Say you have an array for which the ith element is the price of a given stock on day i. Design a ...
- 1. Two Sum I & II & III
1. Given an array of integers, return indices of the two numbers such that they add up to a specific ...
- 【LeetCode】Single Number I & II & III
Single Number I : Given an array of integers, every element appears twice except for one. Find that ...
- 黑科技项目:英雄无敌III Mod <<Fallen Angel>>介绍
英雄无敌三简介(Heroes of Might and Magic III) 英3是1999年由New World Computing在Windows平台上开发的回合制策略魔幻游戏,其出版商是3DO. ...
- hdu acm 1028 数字拆分Ignatius and the Princess III
Ignatius and the Princess III Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K ...
随机推荐
- acwing 652. 切蛋糕
题目地址 今天是小Z的生日,同学们为他带来了一块蛋糕. 这块蛋糕是一个长方体,被用不同色彩分成了N个相同的小块,每小块都有对应的幸运值. 小Z作为寿星,自然希望吃到的第一块蛋糕的幸运值总和最大,但小Z ...
- eclispe git config配置文件配置远程仓库
git config基本配置如下: [core] repositoryformatversion = 0 filemode = false logallrefupdates = true [remot ...
- shutil模块(了解)
目录 一.shutil模块 1.1 zipfile压缩解压缩 1.2 tarfile压缩解压缩 一.shutil模块 高级的文件.文件夹.压缩包处理模块. import shutil # shutil ...
- Python程序中的进程操作-进程池(multiprocess.Pool)
目录 一.进程池 二.概念介绍--multiprocess.Pool 三.参数用法 四.主要方法 五.其他方法(了解) 六.代码实例--multiprocess.Pool 6.1 同步 6.2 异步 ...
- C#读取匿名对象的属性值的方法总结
目录 1.通过反射的方式获取属性值 2.新建个扩展方法,将object转成对应的匿名对象 通过new出匿名对象,可以直接调用该匿名对象的属性名,获取属性值. var objUser = new {Na ...
- html公用头部和尾部
这个方式比较简单,样式和js也有效果,还有object和iframe方式 效果图,可以看出公共的样式对于引入的文件也有效果,在加载完文件后js也是有效果的 index.html header.html ...
- Fragment生命周期函数调用(ViewPager切换方式)
在使用ViewPager时,Google亲爹为我们提供了多种PagerAdapter.其中,与Fragment相关的是FragmentPagerAdapter和FragmentStatePagerAd ...
- 数据库之MySQL与Python交互
准备数据 创建数据表 -- 创建 "京东" 数据库 create database jing_dong charset=utf8; -- 使用 "京东" 数据库 ...
- C# ICloneable,shallow clone,deep clone.
[Serializable] public class Person:ICloneable { public string Name { get; set; } public int Id { get ...
- 练手WPF(三)——扫雷小游戏的简易实现(下)
十四.响应鼠标点击事件 (1)设置对应坐标位置为相应的前景状态 /// <summary> /// 设置单元格图样 /// </summary> /// <para ...