HDU - 1028 step 1:初始化第一个多项式 也就是 由 1的各种方案 组 成 的多项式 初始化系数为 1.临时区 temp初始化 为 0 step 2:遍历后续的n - 1 个 多项式 ,第二重 for  j  代 表 的 存 储 结 果 的 多 项 式的次数,k 代表 当前 第 i 的 多项式的次数 通过计算发现两个多项式相乘 其中一个 系数为1和 0 组成,运算时可以初始化系数数组为0 ,然后 由另一个的系数 与之相加即可得到 G(x)=(1+x+x2+x3+x4+.....)(…
Ignatius and the Princess III HDU - 1028 整数划分问题 假的dp(复杂度不对) #include<cstdio> #include<cstring> typedef long long LL; LL ans[][]; LL n,anss; LL get(LL x,LL y) { ) return ans[x][y]; ) ; ; ans[x][y]=; LL i; ;i<=y;i++) ans[x][y]+=get(x-y,i); re…
题目传送门:https://vjudge.net/problem/HDU-1028 思路:整数拆分构造母函数的模板题 1 //#include<bits/stdc++.h> 2 #include<time.h> 3 #include <set> 4 #include <map> 5 #include <stack> 6 #include <cmath> 7 #include <queue> 8 #include <c…
Ignatius and the Princess III Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 11810    Accepted Submission(s): 8362 Problem Description "Well, it seems the first problem is too easy. I will let…
题目链接:hdu 1028 Ignatius and the Princess III 题意:对于给定的n,问有多少种组成方式 思路:dp[i][j],i表示要求的数,j表示组成i的最大值,最后答案是dp[i][i].那么dp[i][j]=dp[i][j-1]+dp[i-j][i-j],dp[i][j-1]是累加1到j-1的结果,dp[i-j][i-j]表示的就是最大为j,然后i-j有多少种表达方式啦.因为i-j可能大于j,这与我们定义的j为最大值矛盾,所以要去掉大于j的那些值 /*******…
传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1028 Ignatius and the Princess III Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 24967    Accepted Submission(s): 17245 Problem Description "Well…
Ignatius and the Princess III Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Problem Description "Well, it seems the first problem is too easy. I will let you know how foolish you are later." feng5166 says. &…
Ignatius and the Princess III Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 15498    Accepted Submission(s): 10926 Problem Description "Well, it seems the first problem is too easy. I will let…
Ignatius and the Princess III Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 15942    Accepted Submission(s): 11245 Problem Description "Well, it seems the first problem is too easy. I will let…
Ignatius and the Princess III Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 24975    Accepted Submission(s): 17253 Problem Description "Well, it seems the first problem is too easy. I will let…