CF884A.Book Reading
入门
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Recently Luba bought a very interesting book. She knows that it will take t seconds to read the book. Luba wants to finish reading as fast as she can.
But she has some work to do in each of n next days. The number of seconds that Luba has to spend working during i-th day is a__i. If some free time remains, she can spend it on reading.
Help Luba to determine the minimum number of day when she finishes reading.
It is guaranteed that the answer doesn't exceed n.
Remember that there are 86400 seconds in a day.
最近,Luba 买了一本非常有趣的书。她知道读完这本书需要 t 秒。Luba 希望尽快读完这本书。
但在接下来的 n 天中,她每天都有工作要做。第 i 天她需要花费 ai 秒来工作。如果某天还有剩余的空闲时间,她就可以用它来读书。
请帮助 Luba 确定她完成读书的最早天数。
保证答案不超过 n。
注意:一天有 86400 秒。
输入格式
The first line contains two integers n and t (1 ≤ n ≤ 100, 1 ≤ t ≤ 106) — the number of days and the time required to read the book.
The second line contains n integers a__i (0 ≤ a__i ≤ 86400) — the time Luba has to spend on her work during i-th day.
第一行包含两个整数 n 和 t(1 ≤ n ≤ 100,1 ≤ t ≤ 106)—— 分别表示天数和读完这本书所需的时间。
第二行包含 n 个整数 ai(0 ≤ ai ≤ 86400)—— 表示 Luba 在第 i 天需要花费在工作上的时间。
输出格式
Print the minimum day Luba can finish reading the book.
It is guaranteed that answer doesn't exceed n.
输出露芭完成阅读这本书的最少天数。
保证答案不超过 n。
输入输出样例
输入#1
2 2 86400 86398
输出#1
2
输入#2
2 86400 0 86400
输出#2
1
输入解题思路,AI测评打分。不知道怎么写?