hdu4883(贪心)
来源:互联网 发布:淘宝旺铺多少钱一个月 编辑:程序博客网 时间:2024/05/22 13:06
方法很巧妙,仔细看代码
/** this code is made by LinMeiChen* Problem:* Type of Problem:* Thinking:* Feeling:*/#include<iostream>#include<algorithm>#include<stdlib.h>#include<string.h>#include<stdio.h>#include<math.h>#include<string>#include<vector>#include<queue>#include<list>using namespace std;typedef long long lld;typedef unsigned int ud;#define oo 0x3f3f3f3f#define maxn 10010struct Node{ int sit, st, ed;}per[maxn];int sit[1444];int main(){ int T, n; scanf("%d", &T); while (T--) { scanf("%d", &n); for (int i = 1; i <= n; i++) { int st1, st2, ed1, ed2; scanf("%d %d:%d %d:%d", &per[i].sit, &st1, &st2, &ed1, &ed2); per[i].st = st1 * 60 + st2; per[i].ed = ed1 * 60 + ed2; } memset(sit, 0, sizeof sit); for (int i = 1; i <= n;i++) for (int j = per[i].st; j < per[i].ed; j++) sit[j] += per[i].sit; int Max = 0; for (int i = 0; i < 24 * 60; i++) Max = max(Max, sit[i]); printf("%d\n", Max); } return 0;}
0 0
- hdu4883(贪心)
- HDU4883 TIANKENG’s restaurant 【贪心】
- hdu4883
- HDU4883
- HDU4883模拟
- hdu4883/BestCoder#2_1001
- TIANKENG’s restaurant--hdu4883
- hdu4883 & BestCoder Round #2 TIANKENG’s restaurant(暴力)
- hdu4883 TIANKENG’s restaurant 模拟下就好了
- 贪心!
- 贪心~
- 贪心
- 贪心
- 贪心
- 贪心
- 贪心
- 贪心
- 贪心
- 常用正则表达式
- RakNet学习(43) -- NAT Type detection
- RakNet学习(44) -- NAT punchthrough
- 数论--大整数取模
- RakNet学习(45) -- Packet Logger
- hdu4883(贪心)
- RakNet学习(46) -- RakVoice
- poj 1231 The Alphabet Game
- 中央台“互联网时代”纪录片分集要点
- 改Eclipse颜色主题
- RakNet学习(47)-- ReadyEvent
- Atitit. 软件---多媒体区---- jmf 2.1.1 Java Media Framework 支持的格式
- 呜呼!Node.js是什么?
- 感冒发烧不宜吃的食物与可以吃的食物