题解:
简单dp
显然不能超过一半
代码:
#include<bits/stdc++.h> using namespace std; int n,mx,f[5][2505]; int main() { f[0][0]=1; scanf("%d",&n); int mx=(n+1)/2-1; for (int i=1;i<=4;i++) for (int j=1;j<=n;j++) for (int k=1;k<=min(mx,j);k++)f[i][j]+=f[i-1][j-k]; printf("%d",f[4][n]); return 0; }