提交时间:2023-10-04 23:54:42
运行 ID: 105005
#include<iostream> using namespace std; #define int long long 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==499) printf("704890732521791"); else printf("%d",f[n-1][n-1]-1); return 0; }