标签:space iostream algorithm for out auth ring 方法 names
2934 12553
718831 13137761
1 #include <iostream> 2 #include<cstdio> 3 #include<algorithm> 4 #include<cstring> 5 #include<cmath> 6 using namespace std; 7 8 int dp[33005]; 9 10 int main() 11 { 12 int i,j,n; 13 memset(dp,0,sizeof(dp)); 14 dp[0]=1; 15 for(i=1;i<=3;i++)//3种钱币 16 for(j=i;j<=33000;j++)//完全背包 顺序 17 dp[j]+=dp[j-i]; 18 while(~scanf("%d",&n)) 19 { 20 printf("%d\n",dp[n]); 21 } 22 return 0; 23 }
标签:space iostream algorithm for out auth ring 方法 names
原文地址:http://www.cnblogs.com/Annetree/p/6058690.html