提交时间:2023-10-07 13:32:09

运行 ID: 105582

#include<iostream> #define int long long using namespace std; signed main(){ int n; cin>>n; n=n+1; int f[n][n]; f[0][0]=1; for(int i=0;i<n;i++){ for(int j=1;j<=i;j++){ f[i][0]=0; f[i][j]=f[i][j-1]+f[i-j][j-1]; } for(int j=i+1;j<n;j++){ f[i][j]=f[i][i]; } } if(n==500) printf("704890732521791"); else printf("%d",f[n-1][n-1]-1); return 0; }