标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 7658 Accepted Submission(s): 4547
#include<queue> #include<math.h> #include<stdio.h> #include<string.h> #include<string> #include<iostream> #include<algorithm> using namespace std; #define N 32788 #define M 12 int n; int f[N]; int w[4]={0,1,2,3}; int main() { while(~scanf("%d",&n)) { memset(f,0,sizeof(f)); f[0]=1; for(int i=1;i<=3;i++) for(int j=w[i];j<=n;j++) { f[j]=f[j]+f[j-w[i]]; } cout<<f[n]<<endl; } return 0; }
标签:
原文地址:http://www.cnblogs.com/wmxl/p/4749154.html