2768 - DS_2023Spring_Lab1 Scoreboard

Time

2023/03/27 18:30:00 2023/03/27 20:30:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
13859 Lab1 - Wedding

13859 - Lab1 - Wedding   

Description

TA Louis is helping out at his cousin’s wedding, his job is to help the guests to find their seat, it is not an easy job because there are hundreds of people attending, and Louis need to keep track of how many guests have arrived and check how much money is in the red envelope, so please help Louis to build a system to record the guest's name.

Because the venue's parking lot is very crowded, Louis wants the first guest to arrive to choose the innermost parking slot and the last guest to select the outermost parking slot so that he can plan a route for guests to leave will smoothly. Help Louis to come up with the plan.

After the preparation is completed, Louis can finally enjoy his meal. But now he has a new job, which is to “block alcohol” for the groom and bride:


(Figure 1: TA Louis wearing a belt saying: Captain of Alcohol)


TA Louis wants you to record the order of toasting, because he will get a hangover afterward, and he wants to recall everything when he wakes up, please help him.
(In Chinese tradition, the groom and bride should toast table by table to thank every guest for coming to the wedding)

Based on the description above, there are 2 things you need to record:

1. The leaving order of the guests (route planning).
2. Toasting order of each table.

Input

There will be several lines of input, every 2 lines represent an event of the wedding.
1. If the input is for route planning, then the first line will be a single character R.  The second line will be name and arrival time of the guest, separated by one space character. The arrival time is recorded as the number of minutes passed.
2. If the input is for toasting order, the first line will be a single character T.  The second line will be the table number and the glasses of alcohol Louis drink, separated by one space character.

Output

1. The leaving order (planned route).  The outermost guest should leave first, in this format:
    1. The name of the guest, each separated by a space character, and an \n at the end.
    2. The time delta between last arrival and first arrival, in minutes, followed by an \n.
2. The toasting order: 
    1. The number of tables, each separated by a space character, and an \n at the end.
    2. The total amount of glasses Louis has drunk, followed by an \n.

Sample Input  Download

Sample Output  Download

Tags




Discuss