母函数  组合数学

#include<stdio.h>

int c1[125];

int c2[125];

int main()

{

int n,i,j,k;

while(scanf("%d",&n)!=EOF)

{

for(i=0;i<=n;i++)

{

c1[i]=1;

c2[i]=0;

}

for(i=2;i<=n;i++)

{

for(j=0;j<=n;j++)

for(k=0;k+j<=n;k=k+i)

c2[k+j]=c2[k+j]+c1[j];

for(j=0;j<=n;j++)

{

c1[j]=c2[j];

c2[j]=0;

}

}

printf("%d\n",c1[n]);

}

return 0;

}

HDUOj Ignatius and the Princess III 题目1002的更多相关文章

  1. HDU 1028 Ignatius and the Princess III 整数的划分问题(打表或者记忆化搜索)

    传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1028 Ignatius and the Princess III Time Limit: 2000/1 ...

  2. hdu 1028 Ignatius and the Princess III 简单dp

    题目链接:hdu 1028 Ignatius and the Princess III 题意:对于给定的n,问有多少种组成方式 思路:dp[i][j],i表示要求的数,j表示组成i的最大值,最后答案是 ...

  3. Ignatius and the Princess III

    Ignatius and the Princess III Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K ...

  4. hdu 1028 Ignatius and the Princess III (n的划分)

    Ignatius and the Princess III Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K ...

  5. hdu acm 1028 数字拆分Ignatius and the Princess III

    Ignatius and the Princess III Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K ...

  6. hdu 1028 Ignatius and the Princess III(DP)

    Ignatius and the Princess III Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K ...

  7. HDOJ 1028 Ignatius and the Princess III (母函数)

    Ignatius and the Princess III Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K ...

  8. HDU1028 Ignatius and the Princess III 【母函数模板题】

    Ignatius and the Princess III Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K ...

  9. Ignatius and the Princess III --undo

    Ignatius and the Princess III Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (J ...

随机推荐

  1. ROS知识(18)----Pluginlib原理

    目录 Overview Example Providing a Plugin Registering/Exporting a Plugin The Plugin Description File Re ...

  2. Linux知识(7)----远程登录 和远程拷贝

    一.远程登录 1.安装客户端 可以使用ssh(Secure Shell(缩写为SSH))来进行远程的登录.安装ssh的命令为: sudo apt-get install openssh-server ...

  3. ROS知识(8)----CMakeLists.txt文件编写的理解

    ROS(Indigo)编程必须要理解CMakeList.txt的编写规则,教程地址:catkin/CMakeLists.txt,官网有相关的教程,中文的翻译版本写的很不错,教程地址:ROS中的CMak ...

  4. http://bbs.chinaunix.net/thread-169061-1-1.html

    http://bbs.chinaunix.net/thread-169061-1-1.html

  5. 去除ArcMap连接空间数据库中多余的属性表

    这个操作目前可能不具有可行性,但是为了完整性还是在下面讲一下吧.如有兴趣的小伙伴,可以按照下面的操作方式去尝试. 一.需求 去除ArcMap连接空间数据库中多余的属性表. PL/SQL中查询得到的内容 ...

  6. iOS appStore中的应用 实现升级功能

    .h文件中 <UIAlertViewDelegate> .m文件中 #import "SBJson.h"        //解析sbjson 数据 - (void)vi ...

  7. jsp下Kindeditor环境搭建

    1.环境:tomcat 2.需要外部jar包: commons-fileupload-1.2.1.jar commons-io-1.4.jar json_simple-1.1.jar 3.下载Kind ...

  8. ubuntu12.04-server版 倒腾

    前面的话: 第一份工作,在阿里巴巴干了一年零四个月不到几天,来到百度上海.从运维岗转到开发岗.从前端业务线转到后段数据线,基本上算从头开始,给自己鼓个劲. 进到正题,公司发了笔记本,自己原来那个破笔记 ...

  9. Java按键事件KeyEvent

    按键事件可以利用键盘来控制和执行一些动作,或者从键盘上获取输入,只要按下,释放一个键或者在一个组件上敲击,就会触发按键事件.KeyEvent对象描述事件的特性(按下,放开,或者敲击一个键)和对应的值. ...

  10. 第十三章 ThreadPoolExecutor源码解析

    ThreadPoolExecutor使用方式.工作机理以及参数的详细介绍,请参照<第十二章 ThreadPoolExecutor使用与工作机理 > 1.源代码主要掌握两个部分 线程池的创建 ...