## 304 - Department

Moderator: Board moderators

little joey
Guru
Posts: 1080
Joined: Thu Dec 19, 2002 7:37 pm

### Re: 304 - Department

It's been a while, but I was having the same kind of questions. Now that I got Accepted, I can tell which assumptions I made.
arash_cordi wrote:First question:
The problem text says that room numbers are less than 10, but nevertheless, in the example, a room number 10 appears... What IS the limit of the room numbers?
I use 0<floor<16, 0<room<16.
arash_cordi wrote:Second question:
Should agents on the same floor form one elevator queue or two elevator queues - one for UP and one for DOWN?
Yes, two queues. A pater noster has both an up-stream and a down-stream.
arash_cordi wrote:Third question:
What happens if a high ranking agent needs to go to an elevator in which a lower ranking agent is already standing? Should the lower ranking agent step out of the elevator for 5 seconds, or should the older agent wait, or should he just enter?
If there already is an agent in the elevator, coming from another floor and not leaving, the agents in the queue will have to wait, even if they are higher in rank.

Hope it helps someone.

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

### Re: 304 - Department

Input:

Code: Select all

``````A 01:00:01
0301 1
0
B 01:00:07
0301 1
0
.``````
AC output:

Code: Select all

``````A
01:00:01 01:00:31 Entry
01:00:31 01:00:35 Waiting in elevator queue
01:00:35 01:01:35 Stay in elevator
01:01:35 01:01:45 Transfer from elevator to room 0301
01:01:45 01:01:46 Stay in room 0301
01:01:46 01:01:56 Transfer from room 0301 to elevator
01:01:56 01:02:00 Waiting in elevator queue
01:02:00 01:03:00 Stay in elevator
01:03:00 01:03:30 Exit

B
01:00:07 01:00:37 Entry
01:00:37 01:00:40 Waiting in elevator queue
01:00:40 01:01:40 Stay in elevator
01:01:40 01:01:50 Transfer from elevator to room 0301
01:01:50 01:01:51 Stay in room 0301
01:01:51 01:02:01 Transfer from room 0301 to elevator
01:02:01 01:02:05 Waiting in elevator queue
01:02:05 01:03:05 Stay in elevator
01:03:05 01:03:35 Exit

``````
Check input and AC output for thousands of problems on uDebug!

metaphysis
Experienced poster
Posts: 139
Joined: Wed May 18, 2011 3:04 pm

### Re: 304 - Department

For checking whether you use tow queue on elevatoror not.
Input:

Code: Select all

``````C 15:00:00
0201 15
0301 20
0
D 15:00:00
0205 10
0
.
``````
ACed putput:

Code: Select all

``````C
15:00:00 15:00:30 Entry
15:00:30 15:01:00 Stay in elevator
15:01:00 15:01:10 Transfer from elevator to room 0201
15:01:10 15:01:25 Stay in room 0201
15:01:25 15:01:35 Transfer from room 0201 to elevator
15:01:35 15:02:05 Stay in elevator
15:02:05 15:02:15 Transfer from elevator to room 0301
15:02:15 15:02:35 Stay in room 0301
15:02:35 15:02:45 Transfer from room 0301 to elevator
15:02:45 15:03:45 Stay in elevator
15:03:45 15:04:15 Exit

D
15:00:00 15:00:30 Entry
15:00:30 15:00:35 Waiting in elevator queue
15:00:35 15:01:05 Stay in elevator
15:01:05 15:01:15 Transfer from elevator to room 0205
15:01:15 15:01:25 Stay in room 0205
15:01:25 15:01:35 Transfer from room 0205 to elevator
15:01:35 15:02:05 Stay in elevator
15:02:05 15:02:35 Exit

``````