dp原理:
(1)dp[i][j] 表示 i 个节点建 <= j 层树的结果数。结果:res[n][k] = dp[n][k] - dp[n][k-1](res[i][j] 表示用 i 个节点建 j 层数的结果数);
(2)dp[i][j] = E(dp[k][j - 1] * dp[i - k - 1][j - 1])(1 <= k <= i - 2)(E为求和);
(3)注意(2)中k每次加2,因为左右子树的节点数都是奇数。
/*
ID:
LANG: C++
TASK: nocows
*/
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#define IN "nocows.in"
#define OUT "nocows.out"
#define M 205
#define MOD 9901
using namespace std;
int dp[M][M];
int n, k;
void solve()
{
for(int i = 1; i <= k; i++)
dp[1][i] = 1;
for(int i = 2; i <= k; i++) {
for(int j = 1; j <= n; j++) {
for(int l = 1; l <= j - 2; l += 2) {
dp[j][i] += (dp[l][i - 1] * dp[j - l - 1][i - 1]) % MOD;
dp[j][i] %= MOD;
}
}
}
}
int main()
{
freopen(IN, "rb", stdin);
freopen(OUT, "wb", stdout);
while(scanf("%d%d", &n, &k) != EOF) {
solve();
printf("%d\n", (MOD + dp[n][k] - dp[n][k - 1]) % MOD);
}
fclose(stdin);
fclose(stdout);
return 0;
}