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

建议使用的浏览器:

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

3469:Catching the Thief

题目描述
In the Qingshui Village, there's a clever thief and a cleverer police.

There are N houses in Qingshui Village which are located in a straight line. And the N houses are numbered from 1 to N according to the direction of the line. Two houses are consided to be neighbor of each other if and only if there is no other house between them.

The thief hides in one of N houses now, and the police tries to find him out. Every day the police will choose a house to check and he will catch the thief if he hides in that house. If the thief survive the arrest of the police, in the night he will move to a neighboring house to pass through the next day.

What is the number of days the police needs to catch the thief in the worst case?
Remember that the police is a clever man.

输入解释
In the first line, an integer T (T <= 100) indicates the number of cases.
T lines follow. Each contains an integer N described above. (1 <= N <= 10000)


输出解释
For each test case, output “Case x: d” in which x is the number of test case counted from one, and d is the number of days before the police catch the thief in the worst case.

输入样例
2
1
2
输出样例
Case 1: 1
Case 2: 2


提示
Case 1: There is only one room, so the police can catch the thief on the first day.
Case 2: There are two rooms. The police can check room 1 on the first day. The worst case is that the thief is in room 2, but in this case the police
 can check room 1 on the second day and will catch the thief for sure.
来自杭电HDUOJ的附加信息
Author lst
Recommend zhengfeng

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

源链接: HDU-3469

最后修改于 2020-10-25T23:03:52+00:00 由爬虫自动更新

共提交 0

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