#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[])
{int c1[1005],c2[1005];int i,j,k;int n;while(scanf("%d",&n)!=EOF){memset(c1,0,sizeof(c1));memset(c2,0,sizeof(c2));for(i=0;i<=n;i++)//第一个括号内的所有数目 c1[i]=1;//代表第一个括号里的所有系数标为一 for(i=2;i<=n;i++){for(j=0;j<=n;j++)for(k=0;k+j<=n;k+=i)c2[j+k]+=c1[j];for(j=0;j<=n;j++)c1[j]=c2[j],c2[j]=0; } printf("%d\n",c1[n]);} return 0;
}
详细解决方案
HDU Ignatius and the Princess III
热度:67 发布时间:2023-12-05 06:27:07.0
相关解决方案
- UVA 10635 Prince and Princess LCS转化为LIS *
- HDOJ 1029 Ignatius and the Princess IV
- HDOJ 1028 Ignatius and the Princess III
- ACM_搜索:杭电oj1026:Ignatius and the Princess I
- HDOJ 1098 ”Ignatius's puzzle“
- UVA - 10635 Prince and Princess (求LIS)
- 【HDU - 1028 】Ignatius and the Princess III 【母函数】
- (复习次数:1)【HDU 1029】Ignatius and the Princess IV
- HDU1029 Ignatius and the Princess IV (O(n)级别的解法)
- Prince and Princess UVA - 10635(LCS转LIS)
- HDU Ignatius and the Princess III
- 山东省第四届ACM大学生程序设计竞赛Rescue The Princess(一个点绕另一个点的旋转)
- UVA 10635 Prince and Princess(最长公共子序列转为最长上升子序列)
- [Interview Street] Track 1 - Bot saves princess - 2
- HDU 1098 Ignatius's puzzle(据说是规律题,然而我们要以正确的姿势搞定它)
- HDOJ1029 Ignatius and the Princess IV
- uestc1041Hug the princess
- 其他-HDU-1029-Ignatius and the Princess IV
- 攻防世界_Crypto_banana-princess
- 【ZOJ 4097-Rescue the Princess】无向图tarjan缩点+LCA
- Ignatius and the Princess IV【基础DP】
- Ignatius and the Princess III HDU-1028
- [kuangbin带你飞]专题十二 基础DP1 -B - Ignatius and the Princess IV
- 牛客国庆集训派对Day1___J Princess Principal —— 思维 | 线段树 | RMQ
- hdu - 1026 - Ignatius and the Princess I
- Uva - 10635 - Prince and Princess(LCS转LIS)
- UVA - 10635 - Prince and Princess - (LCS最长公共子序列O(n*log(n)),LIS)
- hdoj 1027 Ignatius and the Princess II (STL全排列)
- 例题27 UVa10635 Prince and Princess(DP:LIS的nlogn算法)
- HDU1028 Ignatius and the Princess III(整数拆分:母函数||DP)