博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Educational Codeforces Round 31
阅读量:6213 次
发布时间:2019-06-21

本文共 1356 字,大约阅读时间需要 4 分钟。

A. Book Reading
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

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 ai. 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.

Input

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 ai (0 ≤ ai ≤ 86400) — the time Luba has to spend on her work during i-th day.

Output

Print the minimum day Luba can finish reading the book.

It is guaranteed that answer doesn't exceed n.

Examples
input
2 2 86400 86398
output
2
input
2 86400 0 86400
output
1

 

 直接模拟下最好

#include 
using namespace std;int main(){ int n,k; cin>>n>>k; for(int i=1;i<=n;i++) { int x; cin>>x; k-=86400-x; if(k<=0) { cout<
<

 

转载于:https://www.cnblogs.com/BobHuang/p/7755786.html

你可能感兴趣的文章
新人报道-博客园
查看>>
C#实现对外部程序的调用操作
查看>>
gitignore的配置
查看>>
514:Rails
查看>>
UICollectionViewController
查看>>
CSS布局模型(流动模型、浮动模型、层模型)
查看>>
SQL Server 查询语句(一)
查看>>
新姿势 - 海贼王之伟大航路
查看>>
19个心得 明明白白说Linux下的负载均衡
查看>>
Java Collection 简介
查看>>
字符串公式计算 "(a+b)*c"
查看>>
css-样式重构-代码分享
查看>>
STL中set底层实现方式
查看>>
Git
查看>>
Effective_STL 学习笔记(五) 尽量使用区间成员函数代替他们的单元素兄弟
查看>>
尚学linux课程---12、vim操作命令2
查看>>
javascript进阶课程--第一章--函数
查看>>
使用 JS 关闭警告框及监听自定义事件(amaze ui)
查看>>
P1070 道路游戏
查看>>
维特比算法(Viterbi)
查看>>