提交时间:2023-11-11 10:17:20

运行 ID: 109745

#include<bits/stdc++.h> using namespace std; unsigned long long n,f[30]={1,1,2}; int main(){ while(cin>>n){ if(f[n]){ cout<<f[n]<<endl; continue; } for(int i=3;i<=n;i++){ for(int j=0;j<=i-1;j++){ f[i]+=f[j]*f[i-j-1]; } } cout<<f[n]<<endl; } return 0; }