Codeforces 884 Book Reading
来源:互联网 发布:软件测试做什么 编辑:程序博客网 时间:2024/05/29 18:53
题目地址
题意:告诉你n天的工作时间,每天的时间是86400秒,告诉你这本书要看m秒,问你多少天能看完。
思路:直接模拟,每天的看书时间就是86400-num[i]秒,然后直接算就好了。
#include <iostream>#include <cstring>#include <string>#include <queue>#include <vector>#include <map>#include <set>#include <stack>#include <cmath>#include <cstdio>#include <algorithm>#define N 200010#define LL __int64#define inf 0x3f3f3f3f#define lson l,mid,ans<<1#define rson mid+1,r,ans<<1|1#define getMid (l+r)>>1#define movel ans<<1#define mover ans<<1|1using namespace std;const LL mod = 1e9 + 7;const double eps = 1e-9;int times[N], n, m;int main() { cin.sync_with_stdio(false); while (cin >> n >> m) { for (int i = 0; i < n; i++) { cin >> times[i]; } int days = 0; while (m>0&&days<n) { m -= (86400 - times[days]); days++; } cout << days << endl; } return 0;}
阅读全文
0 0
- Codeforces 884 Book Reading
- codeforces New Year Book Reading
- 【codeforces】New Year Book Reading
- New Year Book Reading CodeForces
- Codeforces 500C New Year Book Reading
- Codeforces 500C New Year Book Reading
- codeforces 500C New Year Book Reading
- CodeForces 500C New Year Book Reading
- C. New Year Book Reading codeforces
- CodeForces 500 C. New Year Book Reading(贪心)
- codeforces 500C New Year Book Reading(取书)
- 【CodeForces】500C - New Year Book Reading(贪心)
- codeforces 500C New Year Book Reading (贪心+思维)
- Codeforces 500C:New Year Book Reading(思维+贪心?)
- codeforces 500c New Year Book Reading 【思维】
- CodeForces 500C New Year Book Reading 贪心
- 【Goodbye2014】Codeforces 500C New Year Book Reading【贪心+模拟】
- Codeforces 820A Mister B and Book Reading
- Javascript闭包
- Django框架—富文本编辑器
- 顶尖专家齐聚 2016中国人工智能大会讲师名单和议题公布
- 锤子与乐视终将“在一起”的 4 条证据
- 帅气!vivo X7星空灰照亮你的美!
- Codeforces 884 Book Reading
- bzoj4717 改装(暴力+二分答案)
- 机器学习第4章第3节 : R语言计算实例
- ANSI C标准库: <ctype.h>下函数讲解
- 跟传统电视说拜拜?液晶电视终结者-坚果S1激光电视评测
- UVA
- 52. N-Queens II
- Dom节点笔记
- C++之容器