Educational Codeforces Round 31
2 seconds
256 megabytes
standard input
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.
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.
Print the minimum day Luba can finish reading the book.
It is guaranteed that answer doesn't exceed n.
2 2
86400 86398
2
2 86400
0 86400
1
直接模拟下最好
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,k;
cin>>n>>k;
for(int i=;i<=n;i++)
{
int x;
cin>>x;
k-=-x;
if(k<=)
{
cout<<i<<endl;
return ;
}
}
return ;
}
Educational Codeforces Round 31的更多相关文章
- Educational Codeforces Round 31 B. Japanese Crosswords Strike Back【暴力】
B. Japanese Crosswords Strike Back time limit per test 1 second memory limit per test 256 megabytes ...
- Educational Codeforces Round 31 A. Book Reading【暴力】
A. Book Reading time limit per test 2 seconds memory limit per test 256 megabytes input standard inp ...
- 【Educational Codeforces Round 31 C】Bertown Subway
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 最后肯定会形成若干个环的. 把最大的两个环合在一起就好. 每个环贡献: 假设x=环的大小 ->x*x 注意int的溢出 [代码 ...
- 【Educational Codeforces Round 31 B】Japanese Crosswords Strike Back
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 所有数字的和加上n-1,如果为x则唯一,否则不唯一 [代码] #include <bits/stdc++.h> usin ...
- 【Educational Codeforces Round 31 A】Book Reading
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 水模拟 [代码] #include <bits/stdc++.h> using namespace std; const ...
- Educational Codeforces Round 32
http://codeforces.com/contest/888 A Local Extrema[水] [题意]:计算极值点个数 [分析]:除了第一个最后一个外,遇到极值点ans++,包括极大和极小 ...
- Educational Codeforces Round 17
Educational Codeforces Round 17 A. k-th divisor 水题,把所有因子找出来排序然后找第\(k\)大 view code //#pragma GCC opti ...
- [Educational Codeforces Round 16]E. Generate a String
[Educational Codeforces Round 16]E. Generate a String 试题描述 zscoder wants to generate an input file f ...
- [Educational Codeforces Round 16]D. Two Arithmetic Progressions
[Educational Codeforces Round 16]D. Two Arithmetic Progressions 试题描述 You are given two arithmetic pr ...
随机推荐
- 【持续更新】HTML5 基础知识
文档类型声明 <!DOCTYPE html> 必不可少,位于文件第一行. 字符编码 <meta charset="UTF-8"> 语义化标记元素 heade ...
- Android5.0以上版本录屏实现
我录屏的方式是分别录制音频和视频,最后合并成mp4格式,比较麻烦,因为网上完整的教程比较少,所以我打算写一个完整版的,照着我的代码写完之后,至少是能够实现功能的,而不是简单的介绍下用法. 1既然是录制 ...
- "Uncaught SyntaxError: Unexpected token <"错误完美解决
今天写代码的时候发现了"Uncaught SyntaxError: Unexpected token <" <html>的js错误,而且还是html的第一行,我就 ...
- this+call、apply、bind的区别与使用
http://www.ruanyifeng.com/blog/2018/06/javascript-this.html https://segmentfault.com/a/1190000018017 ...
- 1658: Easier Done Than Said?
1658: Easier Done Than Said? Time Limit: 1 Sec Memory Limit: 64 MBSubmit: 15 Solved: 12[Submit][St ...
- 一个batch如何通过一个网络
一个batch下所有的图片一起经过整个网络,不是说一张图片经过网络后再让下一张进入网络,这样一个batch一起通过网络计算速度比一张一张这样快
- OS X快捷键小技巧
退出command+Q,关分页Command+W,刷新Command+R,新开分页Command+T 全屏 ctrl+command+F 每个Mac使用者都知道点击下窗口左上角黄色圆形的按钮就可以最小 ...
- HDU-1455-木棒
这题的话,我们,定义一个结构体,然后把木棒从大到小排序. 这些木棒如果是由多根等长木棒组成的,那目标长度一定大于等于其中最长的木棒长度,所这就是我们搜索的下限. 上限就是所有的木棒组成了一根木棒,就是 ...
- Mysql 5.7在Linux上部署及远程访问
序言:最近要和伙伴一起组队,做.NET Core项目.所以自己就租了一个阿里云服务器,并且装了Linux和MySQL.这里面我的Linux是CentOs 7. 第一步 添加Mysql Yum库 这里面 ...
- 命令行发送UDP
https://www.cnblogs.com/Dennis-mi/articles/6866762.html: 如果往本地UDP端口發送數據,那麼可以使用以下命令:echo “hello” > ...