| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 761 人关注过本帖
标题:[求助]大家帮忙看下这个题!
取消只看楼主 加入收藏
zhanghuan_10
Rank: 1
等 级:新手上路
威 望:2
帖 子:751
专家分:0
注 册:2006-10-25
收藏
 问题点数:0 回复次数:4 
[求助]大家帮忙看下这个题!

http://acm.hdu.edu.cn/showproblem.php?pid=1099
Lottery
Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)
Total Submission(s) : 19 Accepted Submission(s) : 12

Problem Description


Eddy's company publishes a kind of lottery.This set of lottery which are numbered 1 to n, and a set of one of each is required for a prize .With one number per lottery, how many lottery on average are required to make a complete set of n coupons?

Input


Input consists of a sequence of lines each containing a single positive integer n, 1<=n<=22, giving the size of the set of coupons.


Output


For each input line, output the average number of lottery required to collect the complete set of n coupons. If the answer is an integer number, output the number. If the answer is not integer, then output the integer part of the answer followed by a space and then by the proper fraction in the format shown below. The fractional part should be irreducible. There should be no trailing spaces in any line of ouput.


Sample Input


2
5
17

Sample Output


3
5
11 --
12
340463
58 ------
720720

我看不懂它的输出到底是什么规律呢?题意也看得很不明白!

搜索更多相关主题的帖子: required blank company Memory number 
2007-01-11 17:39
zhanghuan_10
Rank: 1
等 级:新手上路
威 望:2
帖 子:751
专家分:0
注 册:2006-10-25
收藏
得分:0 
呵呵!自己也顶顶!

该学习了。。。
2007-01-11 19:32
zhanghuan_10
Rank: 1
等 级:新手上路
威 望:2
帖 子:751
专家分:0
注 册:2006-10-25
收藏
得分:0 
呵呵!是acm的一道题:

该学习了。。。
2007-01-12 17:14
zhanghuan_10
Rank: 1
等 级:新手上路
威 望:2
帖 子:751
专家分:0
注 册:2006-10-25
收藏
得分:0 
我的理解是最少需要多少张的彩票才能将这n张彩票收集齐全,但是明显和答案不符,呵呵,想请问一下问什么会得到这个结果?

该学习了。。。
2007-01-12 20:28
zhanghuan_10
Rank: 1
等 级:新手上路
威 望:2
帖 子:751
专家分:0
注 册:2006-10-25
收藏
得分:0 
提示一下算法是怎样的?

该学习了。。。
2007-01-13 19:51
快速回复:[求助]大家帮忙看下这个题!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.012183 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved