#abc265b. B - Explore
B - Explore
Score : points
问题描述
Takahashi 正在一款电子游戏中探索一个洞穴。
该洞穴由 个房间按一行排列。从入口开始,房间依次编号为 Room 。
Takahashi 起初位于 Room ,并且有 时间限制 为 。
对于每个 ,他可以消耗时间为 从第 个房间移动到第 个房间。这是在房间之间移动的唯一方式。他不能做出导致时间限制变为 或更少的移动。
洞穴中有 个奖励房间。第 个奖励房间是 Room ;当他到达这个房间时,时间限制会增加 。
Takahashi 能否到达 Room ?
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
Takahashi is exploring a cave in a video game.
The cave consists of rooms arranged in a row. The rooms are numbered Room from the entrance.
Takahashi is initially in Room , and the time limit is .
For each , he may consume a time of to move from Room to Room . There is no other way to move between rooms. He cannot make a move that makes the time limit or less.
There are bonus rooms in the cave. The -th bonus room is Room ; when he arrives at the room, the time limit increases by .
Can Takahashi reach Room ?
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
If Takahashi can reach Room , print Yes
; otherwise, print No
.
Sample Input 1
4 1 10
5 7 5
2 10
Sample Output 1
Yes
- Takahashi is initially in Room , and the time limit is .
- He consumes a time of to move to Room . Now the time limit is . Then, the time limit increases by ; it is now .
- He consumes a time of to move to Room . Now the time limit is .
- He consumes a time of to move to Room . Now the time limit is .
Sample Input 2
4 1 10
10 7 5
2 10
Sample Output 2
No
He cannot move from Room to Room .
update @ 2024/3/10 11:11:35