Codeforces 884 Book Reading
2017-10-28 11:15
344 查看
题目地址
题意:告诉你n天的工作时间,每天的时间是86400秒,告诉你这本书要看m秒,问你多少天能看完。
思路:直接模拟,每天的看书时间就是86400-num[i]秒,然后直接算就好了。
题意:告诉你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|1 using namespace std; const LL mod = 1e9 + 7; const double eps = 1e-9; int times , 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; }
相关文章推荐
- codeforces-884D Boxes And Balls(思维、三叉哈夫曼树)
- CodeForces-884D:Boxes And Balls(合并石子)
- CodeForces - 820A Mister B and Book Reading
- codeforces 884 D. Boxes And Balls
- Codeforces 884D Boxes and Balls(赫夫曼编码,优先队列)
- CodeForces - 820A Mister B and Book Reading(阅读题)
- codeforces 884D Boxes And Balls (哈夫曼树)
- codeforces 820A. Mister B and Book Reading 解题报告
- CodeForces 820A Mister B and Book Reading
- Codeforces 820A Mister B and Book Reading
- CodeForces 264A Escape from Stones dfs
- Codeforces #409div2 C
- Codeforces 855 C. Helga Hufflepuff’s Cup (树形dp)
- CodeForces 288C
- [广义后缀自动机] BZOJ 3473 字符串 & BZOJ 3277 串 & Codeforces 204E #129 (Div. 1) E. Little Elephant and Strings
- Codeforces 117C解题报告
- CodeForces 25C Roads in Berland(图论-最短路径)
- Codeforces 560E Gerald and Giant Chess 组合数学+DP
- Codeforces 813C The Tag Game
- CodeForces 630C