#C9476. Minimum Conference Rooms
Minimum Conference Rooms
Minimum Conference Rooms
You are given a list of events, where each event has a start time and an end time. Your task is to determine the minimum number of conference rooms required so that all events can take place without any overlap. Two events do not overlap if one ends exactly when the other starts. Formally, given a list of intervals \([s_i, e_i]\), you need to compute the minimum number of rooms such that for every two events assigned to the same room, their time intervals do not intersect.
Input Format: The first line contains an integer \(n\) indicating the number of events. Each of the following \(n\) lines contains two integers \(s\) and \(e\) representing the start and end times of an event.
Output Format: Output a single integer representing the minimum number of conference rooms required.
Example:
Input: 3 0 30 5 10 15 20</p>Output: 2
inputFormat
The first line contains an integer n denoting the number of events. Each of the next n lines contains two space-separated integers indicating the start time and end time of an event. Note that an event ending at time t does not conflict with an event starting at time t.
outputFormat
Output a single integer which is the minimum number of conference rooms required to host all events without any overlapping.## sample
0
0
</p>