TIANKENG manages a restaurant after graduating from ZCMU, and tens of thousands of customers come to have meal because of its delicious dishes. Today n groups of customers come to enjoy their meal, and there are Xi persons in the ith group in sum. As…
TIANKENG's restaurant Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others) Total Submission(s): 0    Accepted Submission(s): 0 Problem Description TIANKENG manages a restaurant after graduating from ZCMU, and tens of t…
TIANKENG’s restaurant(Ⅱ) Time Limit: 16000/8000 MS (Java/Others)    Memory Limit: 130107/65536 K (Java/Others)Total Submission(s): 466    Accepted Submission(s): 153 Problem Description After improving the marketing strategy, TIANKENG has made a fort…
TIANKENG’s restaurant Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 1360    Accepted Submission(s): 545 Problem Description TIANKENG manages a restaurant after graduating from ZCMU, and tens…
称号: TIANKENG's restaurant Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others) Total Submission(s): 249    Accepted Submission(s): 125 Problem Description TIANKENG manages a restaurant after graduating from ZCMU, and t…
链接:http://acm.hdu.edu.cn/showproblem.php?pid=4883 TIANKENG’s restaurant Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 566    Accepted Submission(s): 267 Problem Description TIANKENG manages a…
TIANKENG’s restaurant(Ⅱ) Time Limit: 16000/8000 MS (Java/Others)    Memory Limit: 130107/65536 K (Java/Others)Total Submission(s): 456    Accepted Submission(s): 149 Problem Description After improving the marketing strategy, TIANKENG has made a fort…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4883 解题报告:一家餐馆一天中有n波客人来吃饭,第 i 波  k 客人到达的时间是 s ,离开时的时间是e,求出餐馆最多的时候有多少人? 一开始我用线段树写的,但是RE了,后来看到一种方法,感觉很巧妙:一天时间全部转化成分钟,范围就是从0到1440,全部初始化为0,然后如果在s时间有k个 客人来的时候就在数组的s位置+k,然后在离开的时间e位置-k,最后扫一边数组,扫的过程中不断判断最大值. #in…
链接:pid=4883">带我学习.带我飞 第一次BC,稳挂,WA n多次.今天又一次做了一下 略挫 #include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #include <map> #include <string> #include <vector> #include <set> #inclu…
有一组数据是在客人到达和出发时间,问:多少把椅子的能力,以满足所有客人的需求,可以有一个地方坐下要求. 有些人甚至开始考虑暴力法,这些数据是少,其实这个问题很多数据, 暴力需求O(n*n)的时间效率,显然,将加班,因此,有必要O(n) 或O(nlgn)算法. 属于一道想透了就很easy的,可是没想过就会很困难的题目. 解法是: 把全部客人到来和离开的时间都排成序列.每次客人到来须要n张桌椅,那么就+上n,每次客人离开就会返还n张桌椅,那么就-去n,求这种最大值. 详细算法代码就那么几行,处理IO…