#C11478. Employee Availability Checker
Employee Availability Checker
Employee Availability Checker
You are given the schedules of n employees. Each employee's schedule consists of one or more time intervals during which they are busy, in the format HH:MM-HH:MM
. You are also given a query time range defined by a start time and an end time.
An employee is considered available if none of their busy intervals overlap with the query time range. Formally, an interval [s, e)
does not overlap with the query interval [start, end)
if either
\[
end \le s \quad \text{or} \quad start \ge e
\]
(where the times are in HH:MM
format). Your task is to determine the list of employees who are available during the given time range.
Note: Compare the times as strings (since they are zero padded in HH:MM format), which is valid under the given constraints.
inputFormat
The input is given in the following format from standard input (stdin):
- The first line contains an integer
n
representing the number of employees. - The following
n
blocks describe each employee:- The first line of each block contains the employee's name (a string without spaces) and an integer
m
representing the number of busy intervals. - The next
m
lines each contain a busy interval in the formatHH:MM-HH:MM
.
- The first line of each block contains the employee's name (a string without spaces) and an integer
- The last line contains two strings:
start_time
andend_time
(separated by a space) representing the query time range, wherestart_time
is inclusive andend_time
is exclusive.
outputFormat
Output a single line containing the names of all available employees separated by a single space, in the same order as they appear in the input. If no employee is available, output an empty line.
## sample3
Alice 2
09:00-10:00
12:00-13:00
Bob 2
09:30-10:30
13:00-14:00
Charlie 2
11:00-12:00
14:00-15:00
10:00 11:00
Alice Charlie