PAT甲级【1014 Waiting in Line】】的更多相关文章

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 li…
题目:https://www.patest.cn/contests/pat-a-practise/1014 思路: 直接模拟类的题. 线内的各个窗口各为一个队,线外的为一个,按时间模拟出队.入队. 注意点:即使到关门时间,已经在服务中的客户(窗口第一个,接待时间早于关门时间)还是可以被服务的.其它的则不服务. #include<iostream> #include<vector> #include<set> #include<map> #include<…
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…
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 lin…
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,Q(N<=20,M<=10,K,Q<=1000),N为银行窗口数量,M为黄线内最大人数,K为需要服务的人数,Q为查询次数.输入K个正整数,分别代表每位顾客需要被服务的时间,Q次查询每次查询一位顾客被服务完离开银行的时间.如果他在五点以前(不包括五点)没有开始被服务,输出“Sorry”. trick: 在五点以前(不包括五点)没有开始被服务,输出“Sorry”,而不是被服务完时间在五点以后(以题面为准). AAAAAccepted code: #inclu…
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 i…
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…