## nyist_xiaod

When you want to give up, think of why you persist until now.

# HDU 1028 Ignatius and the Princess III（母函数）

#include <stdio.h>
#include <string.h>
const int MAX=120;
int main()
{
int n,c1[MAX+5],c2[MAX+5];
while(~scanf("%d",&n))
{
memset(c1,0,sizeof(c1));
memset(c2,0,sizeof(c2));
c1[0]=1;
for(int i=1;i<=n;i++)
{
for(int j=0;j<=n;j++)
{
for(int k=0;j+k*i<=n;k++)
{
c2[j+k*i] += c1[j];
}
}
memcpy(c1,c2,sizeof(c2));
memset(c2,0,sizeof(c2));
}
printf("%d\n",c1[n]);
}
return 0;
}

#### hdu 1028 Ignatius and the Princess III ( 母函数）

2014-07-30 17:11:07

#### 【完全背包/母函数/递推】HDU1028-Ignatius and the Princess III

2016-08-14 23:43:59

#### 杭电1028 Ignatius and the Princess III（母函数）

2014-08-08 21:25:19

#### B - Ignatius and the Princess III 整数拆分问题

2016-11-01 21:02:20

#### HDOJ 1028 Ignatius and the Princess III

2014-06-30 16:02:42

#### HDOJ Ignatius and the Princess III

2011-09-16 22:30:06

#### 经典好题！杭电OJ--Ignatius and the Princess I

2012-10-05 14:54:57

#### Ignatius and the Princess III（母函数一种技巧性的暴力）

2014-08-31 15:41:47

#### HDU 1026 Ignatius and the Princess I （BFS）

2016-05-28 16:04:35

#### 杭电 hdu 1026 Ignatius and the Princess I（BFS+优先队列+墨迹人的输出）

2016-01-19 12:23:35