我是靠谱客的博主 眯眯眼咖啡豆,最近开发中收集的这篇文章主要介绍ZCMU暑期训练四-L - Filling Shapes,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

You have a given integer nn. Find the number of ways to fill all 3×n3×n tiles with the shape described in the picture below. Upon filling, no empty spaces are allowed. Shapes cannot overlap.

This picture describes when n=4n=4. The left one is the shape and the right one is 3×n3×n tiles.
Input
The only line contains one integer nn (1≤n≤601≤n≤60) — the length.

Output
Print the number of ways to fill.

Examples
Input
4
Output
4
Input
1
Output
0
Note
In the first example, there are 44 possible cases of filling.

In the second example, you cannot fill the shapes in 3×13×1 tiles.

题面:铺地砖 几种方案;
思路:判断怎么铺 然后就是2^n;

#include<iostream>
using namespace std;
int main(){
	int n;
	cin>>n;
    cin >> n;
    if(n%2 == 1) cout << "0" << endl;
    else cout << (1<<(n/2)) << endl;
	return 0;
}

最后

以上就是眯眯眼咖啡豆为你收集整理的ZCMU暑期训练四-L - Filling Shapes的全部内容,希望文章能够帮你解决ZCMU暑期训练四-L - Filling Shapes所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(70)

评论列表共有 0 条评论

立即
投稿
返回
顶部