hdu1028 母函数
2013-10-29 16:43
495 查看
#include<iostream> #define N 120+1 using namespace std; int main() { int c1 ,c2 ;//c1表示前面所有项的多项式系数,c2为前所有项和当前项相乘的多项式系数临时数组 int n; 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+=i) { c2[k+j]+=c1[j]; } } for (int j=0;j<=n;j++) { c1[j]=c2[j]; c2[j]=0; } } cout<<c1 <<endl; } return 0; }
相关文章推荐
- HDU_Steps7.3 母函数,组合 HDU2451 HDU1398 HDU2152 HDU1709 HDU1028 HDU3398 HDU2179
- hdu1028 Ignatius and the Princess III(母函数)
- hdu1028(母函数应用)
- HDU1028 Ignatius and the Princess III 【母函数模板题】
- HDU1398-Square Coins,HDU1028-Ignatius and the Princess III(母函数)
- 【母函数】hdu1028 Ignatius and the Princess III
- hdu1028(母函数)
- hdu1028;hdu1398——母函数入门
- HDU1028 Ignatius and the Princess III【母函数】【完全背包】
- HDU1028 母函数+DP求分解因子+背包
- HDU1028 (母函数模板)
- HDU1028(母函数)
- hdu1028 (母函数模板题)
- 【母函数】hdu1028(Ignatius and the Princess III)
- HDU1028:Ignatius and the Princess III(dp入门 & 母函数)
- [HDU1085][HDU1028][HDU2013] 组合数学入门(母函数、递推)
- hdu1028(母函数+DP)
- 【完全背包/母函数/递推】HDU1028-Ignatius and the Princess III
- hdu1028 Ignatius and the Princess III (母函数习题)
- HDU1028关于母函数以及递推