PAT-A1014 Waiting in Line 题目内容及题解

该博客详细介绍了PAT(A1014)编程题的题目内容、解题思路、代码实现以及运行结果。题目要求模拟银行排队服务,考虑窗口数量、每队最大人数、顾客数量和查询的顾客编号,输出顾客完成交易的具体时间。解题思路包括设置结构体记录信息,模拟队列加入和处理过程,对于17点后未能开始服务的顾客输出'Sorry'。
摘要由CSDN通过智能技术生成

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 enough to contain a line with M customers. Hence when all the N lines are full, all the customers after (and including) the (NM+1)st one will have to wait in a line behind the yellow line.
  •     Each customer will choose the shortest line to wait in when crossing the yellow line. If there are two or more lines with the same length, the customer will always choose the window with the smallest number.
  •     Customer​i​​ will take T​i​​ minutes to have his/her transaction processed.
  •     The first N customers are assumed to be served at 8:00am.

Now given the processing time of each customer, you are supposed to tell the exact time at which a customer has his/her business done.

Fo

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值