状态转移方程
1、dp[i][k] += dp[i - 1 - j][k - 1] * dp[j][k - 1]
2、dp[i][k] += 2 * dp[i - 1 - j][k - 2] * dp[j][k - 1]
#include<bits\stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define MOD 1000000007
const int MAXN = 2001;
const int tier = 11;
typedef long long ll;
ll dp[MAXN][tier];
void init()
{
dp[0][0] = 1;
dp[1][1] = 1;
for (int i = 2; i < MAXN; i++)
{
for (int k = 2; k < tier; k++)
{
for (int j = 0; j < i; j++)
{
dp[i][k] += dp[i - j - 1][k - 1] * dp[j][k - 1];
dp[i][k] %= MOD;
dp[i][k] += 2 * dp[i - j - 1][k - 2] * dp[j][k - 1];
dp[i][k] %= MOD;
}
}
}
}
int main()
{
int n;
init();
while (scanf("%d", &n) == 1)
{
ll ans = 0;
for (int i = 1; i < tier; i++)
{
ans += dp[n][i];
ans %= MOD;
}
printf("%I64d\n", ans);
}
return 0;
}