Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 5355 Accepted Submission(s): 3037
继续水DP
#include <stdio.h> #include <string.h> #define N 35000 int dp[N]; int main() { int n,i,j; dp[0] = 1; for(i = 1 ; i <=3 ;i++) { for(j = i; j<=N ; j++) if(dp[j-i]) dp[j]+=dp[j-i]; } while(~scanf("%d",&n)) { printf("%d\n",dp[n]); } return 0; }
原文:http://www.cnblogs.com/llei1573/p/3849761.html