这题比较简单,但还是发表一下吧

魈凯KBS  •  5个月前


include <bits/stdc++.h>

using namespace std; const int N=1e7+10; const int INF=0x3f3f3f3f; long long a[110]; int n; int main() {

cin>>n;
a[2]=1;
a[3]=1;
for(int i=4;i<=n;i++)
{
	for(int j=2;j<=i-1;j++)
	{
		a[i]+=a[j]*a[i-j+1];
	}
}
cout<<a[n];
return 0;

}


Comments: