const int maxn = 5100; ULL g[maxn], f[maxn]; void init() { g[2] = 1; f[2] = 1; FF(i, 3, maxn) { int sum = i + 1; FE(j, 2, i - 1) g[i] += f[j] * f[sum - j]; FE(j, 3, i - 1) f[i] += g[j] * f[sum - j]; f[i] += g[i]; } } int main() { init(); int n; while (~RI(n)) { cout << f[n] << endl; } return 0; }
Polygon Division,布布扣,bubuko.com
原文:http://blog.csdn.net/wty__/article/details/38441389