B - Explore【AtCoder Beginner Contest 265】

Takahashi正在探索一个包含N个房间的线性洞穴,初始位于第1个房间,时间限制为T。每个房间之间的移动会消耗时间,并存在M个奖励房间可以增加时间限制。问题在于判断Takahashi能否在时间限制内到达最后一个房间。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

B - Explore

Time Limit: 2 sec / Memory Limit: 1024 MB

Score : 200 points

Problem Statement

Takahashi is exploring a cave in a video game.

The cave consists of N rooms arranged in a row. The rooms are numbered Room 1,2,\ldots,N from the entrance.

Takahashi is initially in Room 1, and the time limit is T.
For each 1 \leq i \leq N-1, he may consume a time of A_i to move from Room i to Room (i+1). There is no other way to move between rooms. He cannot make a move that makes the time limit 0 or less.

There are M bonus rooms in the cave. The i-th bonus room is Room 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值