标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 14695 Accepted Submission(s): 10348
#include<iostream> #include<cstdio> #include<cstring> #include<string> #include<cmath> #include<cstdlib> #include<algorithm> #include<queue> #include<vector> #include<stack> #include<set> using namespace std; int n,c1[125],c2[125]; int main() { while(scanf("%d",&n)!=EOF) { for(int i=0;i<=n;i++) c1[i]=1,c2[i]=0; for(int i=2;i<=n;i++) { for(int j=0;j<=n;j++) { for(int k=0;k+j<=n;k=k+i) { c2[j+k]+=c1[j]; } } for(int j=0;j<=n;j++) { c1[j]=c2[j]; c2[j]=0; } } printf("%d\n",c1[n]); } return 0; }
标签:
原文地址:http://www.cnblogs.com/a972290869/p/4402141.html