CF1182A.Filling Shapes

入门

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

You have a given integer nn. Find the number of ways to fill all 3×n3 \times 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 \times n tiles.

给定一个正整数 nn。求用下图所示形状完全铺满 3×n3 \times n 网格的方案数。铺放时不允许留空,且各形状不能重叠。


该图展示的是 n=4n = 4 的情形:左侧为所用形状,右侧为 3×n3 \times n 网格。

输入格式

The only line contains one integer nn (1≤n≤601 \le n \le 60) — the length.

唯一的一行包含一个整数 nn(1≤n≤601 \le n \le 60)—— 表示长度。

输出格式

Print the number of ways to fill.

输出填充方式的数量。

输入输出样例

  • 输入#1

    4

    输出#1

    4
  • 输入#2

    1

    输出#2

    0

说明/提示

In the first example, there are 44 possible cases of filling.

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

在第一个例子中,有 44 种可能的填充方式。

在第二个例子中,无法用 3×13 \times 1 的方块来填充这些图形。

输入解题思路,AI测评打分。不知道怎么写?

首页