HDU_4883
TIANKENG’s restaurant
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others)
Total Submission(s): 1760 Accepted Submission(s): 635
ith group in sum. Assuming that each customer can own only one chair. Now we know the arriving time STi and departure time EDi of each group. Could you help TIANKENG calculate the minimum chairs he needs to prepare so that every customer can take a seat when
arriving the restaurant?
Each cases has a positive integer n(1<=n<=10000), which means n groups of customer. Then following n lines, each line there is a positive integer Xi(1<=Xi<=100), referring to the sum of the number of the ith group people, and the arriving time STi and departure
time Edi(the time format is hh:mm, 0<=hh<24, 0<=mm<60), Given that the arriving time must be earlier than the departure time.
Pay attention that when a group of people arrive at the restaurant as soon as a group of people leaves from the restaurant, then the arriving group can be arranged to take their seats if the seats are enough.
2
2
6 08:00 09:00
5 08:59 09:59
2
6 08:00 09:00
5 09:00 10:00
11
6//求区间最大相交的问题、暴力解法
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <algorithm>
#include <stack>
#include <cstdlib>
using namespace std; int main() {
int t ;
cin >> t;
while (t --) {
int n;
scanf("%d",&n);
int s1, s2, s3, s4;
int c[1500];
memset(c, 0, sizeof(c));
int num ;
while (n --) {
scanf("%d",&num);
scanf("%d:%d %d:%d",&s1,&s2,&s3,&s4);
int be = s1*60 + s2;
int en = s3*60 + s4;
for (int i = be; i<en; i++)
c[i] += num;
}
int max = 0;
for (int i = 1; i<=1440; i++) {
if (c[i] > max)
max = c[i];
}
printf("%d\n",max);
} return 0 ;
}
HDU_4883的更多相关文章
随机推荐
- 快速学习Bash
作者:Vamei 出处:http://www.cnblogs.com/vamei 严禁转载. Shell是Linux下经典的文本互动方式,而Bash是现在最常用的一种Shell.我在这里总结了Bash ...
- windows server 2008 R2服务器安装IIS并添加网站
一.连接远程计算机 1.因为我的电脑是win7系统,故这里以win7为例,其他windows系统大同小异,首先点开开始菜单栏,在windows附件下找到远程桌面连接 或者采用通用的方法,利用快捷键wi ...
- CET——4 常用短语
在网上看到的,先拔到自己这来,四级大大,求过!!!!
- Redis在APP中的应用
前言 redis 是内存型数据库,读取data速度远快于mysql和sqlserver,如果将APP中列表信息或者一些常被访问的信息转存至内存上,然后APP通过redis读取内存上的数据,那么APP的 ...
- Dubbo(二) 认识Zookeeper
前言 在昨天,我们给大家基本介绍了Dubbo,文中反复提到了Zookeeper,那么它到底是什么呢,这篇文章我们将从Dubbo层面去了解Zookeeper,不做全面讲解,毕竟这是Dubbo教程啊~ Z ...
- Webpack 2 视频教程 009 - 配置 ESLint 实现代码规范自动测试 (上)
原文发表于我的技术博客 这是我免费发布的高质量超清「Webpack 2 视频教程」. Webpack 作为目前前端开发必备的框架,Webpack 发布了 2.0 版本,此视频就是基于 2.0 的版本讲 ...
- hiberation4 获取session
T t; Configuration cfg = new Configuration(); cfg.configure(); ServiceRegistry serviceRegistry = new ...
- IE下判断IE版本的语句...[if lte IE 8]……[endif]
<!--[if lte IE 6]> <![endif]--> IE6及其以下版本可见 <!--[if lte IE 7]> <![endif]--> ...
- vs2017中生成.Net Standard Libarary的Nuget Package
场景: Project A 对Project B存在 project to project reference.这种场景下必须为两者都生成nuget package.这样在load Project A ...
- longest valid parentheses方法归纳
题目大意见leetcode,下面我稍微介绍下想到的三种方法: 方法一:不用栈去找匹配 建立一个数组l2表示匹配,然后i从0开始,看到 ( 就把l2对应的数值记为-1,直到看到 ),找到)以后,从当前i ...