-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path1182A - Filling Shapes.cpp
More file actions
53 lines (36 loc) · 886 Bytes
/
1182A - Filling Shapes.cpp
File metadata and controls
53 lines (36 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
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<bits/stdc++.h>
using namespace std;
void solve() {
int n;
cin >> n;
if (n % 2) cout << 0 << "\n";
else cout << (int)pow(2, n / 2) << "\n";
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t = 1;
//cin >> t;
while (t--) solve();
return 0;
}