当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

1028:Ignatius and the Princess III

题目描述
"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!"
输入解释
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.
输出解释
For each test case, you have to output a line contains an integer P which indicate the different equations you have found.
输入样例
4
10
20
输出样例
5
42
627
来自杭电HDUOJ的附加信息
Author Ignatius.L
Recommend

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-1028

最后修改于 2020-10-25T22:41:31+00:00 由爬虫自动更新

共提交 449

通过率 74.61%
时间上限 内存上限
2000/1000MS(Java/Others) 65536/32768K(Java/Others)