Codeforces Round #566 (Div. 2)A. Filling Shapes
作者:互联网
You have a given integer n. Find the number of ways to fill all 3×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=4. The left one is the shape and the right one is 3×n tiles.
Input
The only line contains one integer n (1≤n≤60) — the length.
Output
Print the number of ways to fill.
Examples
inputCopy
4
outputCopy
4
inputCopy
1
outputCopy
0
Note
In the first example, there are 4 possible cases of filling.
In the second example, you cannot fill the shapes in 3×1 tiles.
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<iostream>
#include<algorithm>
#include<map>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<string>
#define ll long long
#define dd double
using namespace std;
int main() {
ios::sync_with_stdio(false);
ll n; cin >> n;
if (n % 2 == 1) {
cout << "0" << endl;
}
else {
ll p;
p = pow(2, n / 2);
cout << p << endl;
}
}
标签:tiles,Codeforces,566,number,Shapes,shape,long,include,fill 来源: https://blog.csdn.net/weixin_44231195/article/details/92175625