大学职业资格刷题搜题APP
下载APP
课程
题库模板
WORD模板下载
EXCEL模板下载
题库创建教程
创建题库
登录
logo - 刷刷题
创建自己的小题库
搜索
【简答题】

淘汰赛问题
题目:
Our school is planning to hold a new exciting computer programming contest. During each round of the contest, the competitors will be paired, and compete head-to-head. The loser will be eliminated, and the winner will advance to next round. It proceeds until there is only one competitor left, who is the champion. In a certain round, if the number of the remaining competitors is not even, one of them will be chosed randomly to advance to next round automatically, and then the others will be paired and fight as usual. The contest committee want to know how many rounds is needed to produce to champion, then they could prepare enough problems for the contest.
Input
The input consists of several test cases. Each case consists of a single line containing a integer N - the number of the competitors in total. 1 <= N <= 2,147,483,7. An input with 0(zero) signals the end of the input, which should not be processed.
Output
For each test case, output the number of rounds needed in the contest, on a single line.
Sample Input
8
16
15
0
Sample Output
3
4
4

题目标签:问题淘汰赛
手机使用
分享
复制链接
新浪微博
分享QQ
微信扫一扫
微信内点击右上角“…”即可分享
反馈
收藏 - 刷刷题收藏
举报
刷刷题
参考答案:
举一反三

【多选题】基于Internet的EDI存在的问题有()。

A.
安全问题
B.
网络营运的可靠性
C.
成本问题
D.
第三方认证问题

【多选题】研究有关领导问题的理论有______

A.
领导性格理论
B.
强化理论
C.
领导行为理论
D.
领导权变理论
E.
需求层次理论
相关题目:
【多选题】基于Internet的EDI存在的问题有()。
A.
安全问题
B.
网络营运的可靠性
C.
成本问题
D.
第三方认证问题
【多选题】研究有关领导问题的理论有______
A.
领导性格理论
B.
强化理论
C.
领导行为理论
D.
领导权变理论
E.
需求层次理论
刷刷题-刷题-导入试题 - 刷刷题
参考解析:
题目纠错 0
发布
刷刷题-刷题-导入试题 - 刷刷题刷刷题-刷题-导入试题 - 刷刷题刷刷题-刷题-导入试题 - 刷刷题
刷刷题-刷题-导入试题 - 刷刷题
刷刷题-刷题-导入试题 - 刷刷题
刷刷题-单词鸭