Type: Default 1000ms 256MiB

踩方格

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Description

有一个方格矩阵,矩阵边界在无穷远处。我们做如下假设:

a、每走一步时,只能从当前方格移动一格,走到某个相邻的方格上;

b、走过的格子立即塌陷无法再走第二次;

c、只能向北、东、西三个方向走;

请问:如果允许在方格矩阵上走n步,共有多少种不同的方案。2种走法只要有一步不一样,即被认为是不同的方案。

## Input Format

允许在方格上行走的步数n(n≤20)。

## Output Format

计算出的方案数量。

```input1 2

```output1
7

2026-4-26递推练习

Not Attended
Status
Done
Rule
XCPC
Problem
9
Start at
2026-4-26 13:30
End at
2026-4-26 16:30
Duration
3 hour(s)
Host
Partic.
8