纯属于敢想就敢做的题目,列出来状态转移就OK了
#include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
using namespace std;
int dp[201][201];
int main()
{int n,i,j,k;scanf("%d",&n);dp[0][0]=1;for(i=1;i<=n;i++){for(j=1;j<=i;j++){for(k=0;k<j;k++){dp[i][j]+=dp[i-j][k];}}}int sum;sum=0;for(i=0;i<=n;i++)sum+=dp[n][i];cout<<sum-1<<endl;return 0;
}