幽灵藏宝
a ghost moves the treasure to an adjacent room
题目详情
有一排 10 个房间,其中一个房间里有宝藏。每天夜里幽灵会把宝藏移动到相邻的房间(只能移动 1 间)。
你每天只能检查 1 个房间。如何保证最终找到宝藏?
英文原题
There is a row of 10 rooms and a treasure in one of them. Each night, a ghost moves the treasure to an adjacent room. You are trying to find the treasure, but can only check one room per day. How do you find it?
解析
用“从一端扫到另一端再扫回来”的固定策略即可保证抓到。
例如按如下顺序每天检查:
直观理由:宝藏每天最多移动 1 格,而你在扫的过程中每天检查的位置也在单步移动。宝藏不可能“跳过”你正在推进的检查前沿;当你扫到端点并折返时,会把宝藏的可能位置区间持续压缩并最终在某一天与你检查的房间重合,因此必能找到。
英文解析
A fixed strategy of sweeping from one end to the other and then back is sufficient to guarantee catching the treasure.
For example, check the rooms in the following order each day:
Intuitive reasoning: The treasure can move at most one room per day, while your inspection path also moves one room per day. The treasure cannot "skip" over the advancing front of your inspection. When you reach an endpoint and turn back, you continuously narrow the possible interval where the treasure could be, eventually causing it to coincide with the room you inspect on a specific day, thus guaranteeing a capture.