对于一个序列,有多少个出入栈序列
#include <iostream>
using namespace std;
int n;
long long f[25];
int main() {
f[0] = 1;
cin >> n;
for (int i = 1; i <= n; i++)
f[i] = f[i - 1] * (4 * i - 2) / (i + 1);//卡特兰公式
cout << f[n] << endl;
return 0;
}
来源:CSDN
作者:Yun102400
链接:https://blog.csdn.net/qq_42188312/article/details/104089002