Ignatius and the Princess III

Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other)
Total Submission(s) : 56   Accepted Submission(s) : 41
Problem Description
"Well, it seems the first problem is too easy. I will let you know how foolish you are later." feng5166 says."The second problem is, given an positive integer N, we define an equation like this:N=a[1]+a[2]+a[3]+...+a[m];a[i]>0,1<=m<=N;My
question is how many different equations you can find for a given N.For example, assume N is 4, we can find:4 = 4;4 = 3 + 1;4 = 2 + 2;4 = 2 + 1 + 1;4 = 1 + 1 + 1 + 1;so the result is 5 when N is 4. Note that "4 = 3 + 1" and "4 = 1 + 3" is the same in this
problem. Now, you do it!"
 
Input
The input contains several test cases. Each test case contains a positive integer N(1<=N<=120) which is mentioned above. The input is terminated by the end of file.
 
Output
For each test case, you have to output a line contains an integer P which indicate the different equations you have found.
 
Sample Input
4
10
20
 
Sample Output
5
42
627
 




Ignatius and the Princess III --undo的更多相关文章

  1. 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 ...

  2. 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 ...

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

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

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

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

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

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

  6. Ignatius and the Princess III

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

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

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

  8. 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 ...

  9. HDU 1028 整数拆分问题 Ignatius and the Princess III

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

随机推荐

  1. apache也可以做负载均衡,跟nignx的区别是什么?

    后续更新中.. 参考 http://zhumeng8337797.blog.163.com/blog/static/100768914201242211633248/ 比较 http://zhan.r ...

  2. oracle 数据库开发面试题,当时笔试的时候一个没做出来,现附原题及答案

    1. ID123567810111215 表名tt,用sql找出ID列中不连续的ID,例如其中没有的4: --创建表及数据 CREATE TABLE tt(ID INTEGER); INSERT IN ...

  3. 东软实训1 -jsp内置对象及其常用方法

    JSP 的内置对象及方法详细说明 一. request 对象 客户端的请求信息被封装在 request 对象中,通过它才能了解到客户的需 求,然后做出响应.它是 HttpServletRequest ...

  4. python实现发工资脚本

    好开心啊,在旁边大神的帮助下,终于实现了发工资的python脚本,之前用shell写的老出错,刚才测试,发80个人工资详情,妥妥的,代码如下: from email.mime.multipart im ...

  5. d3可视化实战03:神奇的superformula

    需求驱动实现 前文讲过了D3的数据驱动机制,中间所举的例子都很简单.例如那个demo里面,绑定的数据是一个简单的数组,实现的图元也仅仅是一堆用SVG画的circle.但是现实世界中我们往往会遇到复杂的 ...

  6. 使用__autoload()来管理文件导入

    其基本思想是把要使用到的其他资源文件统一使用__autoload()方法来管理,我们在使用的时候只需要引入包含__autoload()方法的文件即可.其对性能的影响是微乎其微的,但是带来的好处是巨大的 ...

  7. Cracking the coding interview--Q2.1

    原文: Write code to remove duplicates from an unsorted linked list.FOLLOW UPHow would you solve this p ...

  8. CreateFile FileSeek FileRead 直接读取数据

    unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms ...

  9. owncloud乱码问题

    没有人回答那我就献丑了,废话有点多,请跳着看. 先说结论:最后我选择了 Seafile 我去年之前用box同步个人文件,前几个月的时候吧,发现box不能上传几百M的文件,我才知道之前为什么会丢文件了… ...

  10. 找到 OSChina 早上 8 点钟容易宕机的原因 ?

    最近一段时间,OSChina 网站在早上 8 点出头的时候很容易因为数据库连接池爆满而导致网站宕机.表现的情况是数据库处理大量的查询,堆积大量并发连接,导致无法再连接到数据库,执行一个简单的查询速度也 ...