| A table tennis club has N tables available to the public. The tables are numbered from 1 to N. For any pair of players, if there are some tables open when they arrive, they will be assigned to the available table with the smallest number. If all the tables are occupied, they will have to wait in a queue. It is assumed that every pair of players can play for at most 2 hours. Your job is to count for everyone in queue their waiting time, and for each table the number of players it has served for the day. One thing that makes this procedure a bit complicated is that the club reserves some tables for their VIP members. When a VIP table is open, the first VIP pair in the queue will have the privilege to take it. However, if there is no VIP in the queue, the next pair of players can take it. On the other hand, if when it is the turn of a VIP pair, yet no VIP table is available, they can be assigned as any ordinary players. Input Specification:Each input file contains one test case. For each case, the first line contains an integer |
1026 Table Tennis
最新推荐文章于 2023-08-09 17:57:20 发布
本文介绍了一种桌球俱乐部的调度算法,旨在合理分配普通和VIP顾客的游玩时间和桌子资源,确保顾客等待时间最短,并统计每张桌子的服务人数。

最低0.47元/天 解锁文章
473

被折叠的 条评论
为什么被折叠?



