1014. Waiting in Line (模拟)】的更多相关文章

Suppose a bank has N windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. The rules for the customers to wait in line are: The space inside the yellow line in front of each window is…
n个窗口就有n个队列,模拟这n个队列就可以了.需要注意的是,一个人在选择排队窗口的时候,他会选择排队人数最少的窗口,如果存在多个窗口排队的人数相同,那么他会选择编码最小的窗口. Note that since the bank is closed everyday after 17:00, for those customers who cannot be served before 17:00, you must output "Sorry" instead.这句话的意思就是:对于那…
1014. Waiting in Line (30) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Suppose a bank has N windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. The rules for…
1014 Waiting in Line (30 分)   Suppose a bank has N windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. The rules for the customers to wait in line are: The space inside the yellow li…
PAT甲级1014. Waiting in Line 题意: 假设银行有N个窗口可以开放服务.窗前有一条黄线,将等候区分为两部分.客户要排队的规则是: 每个窗口前面的黄线内的空间足以包含与M个客户的一条线.因此,当所有N行都满时, 所有的客户(和包括)(NM + 1)第一个将不得不等待在黄线后面的一行. 每个客户将选择最短的行,以便在穿过黄线时等待.如果长度相同的两行以上,客户将始终选择数字最小的窗口. 客户[i]将在T [i]分钟内处理他/她的交易. 前N名客户被假定在上午8:00送达. 现在…
1014 Waiting in Line (30分)   Suppose a bank has N windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. The rules for the customers to wait in line are: The space inside the yellow lin…
题目:https://www.patest.cn/contests/pat-a-practise/1014 思路: 直接模拟类的题. 线内的各个窗口各为一个队,线外的为一个,按时间模拟出队.入队. 注意点:即使到关门时间,已经在服务中的客户(窗口第一个,接待时间早于关门时间)还是可以被服务的.其它的则不服务. #include<iostream> #include<vector> #include<set> #include<map> #include<…
Waiting in Line Suppose a bank has N windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. The rules for the customers to wait in line are: The space inside the yellow line in front of…
题意:n个窗口,每个窗口可以排m人.有k为顾客需要办理业务,给出了每个客户的办理业务时间.银行在8点开始服务,如果窗口都排满了,客户就得在黄线外等候.如果有一个窗口用户服务结束,黄线外的客户就进来一个.如果有多个可选,选窗口id最小的.输出查询客户的服务结束时间. 如果客户在17点(注意是包括的!!!就在这里被坑了,一开始还以为不包括...)或者以后还没开始服务,就输出Sorry如果已经开始了,无论多长都会继续服务的. 思路:建立一个优先级队列,存储在黄线之内的所有客户.对于m*n之前的人,依此…
problem Suppose a bank has N windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. The rules for the customers to wait in line are: The space inside the yellow line in front of each wi…