#K84902. Schedule Conflict Checker
Schedule Conflict Checker
Schedule Conflict Checker
You are given a set of scheduled events and a new event. Each event is represented by a start time and an end time in the format HH:MM
. Your task is to determine if the new event conflicts with any of the existing events.
An event is considered not to conflict if it meets one of the following conditions for every existing event:
- The new event ends before the existing event starts: \( new\_end \le existing\_start \)
- The new event starts after the existing event ends: \( new\_start \ge existing\_end \)
If neither condition holds for any existing event, then the new event is said to have a conflict. Otherwise, it is conflict-free.
inputFormat
The input will be provided via standard input (stdin) with the following format:
N start1 end1 start2 end2 ... (N lines representing the existing events) new_start new_end
Where:
- N is the number of existing events.
- Each event's start and end times are given in the format HH:MM.
- The final line contains the start and end time of the new event.
outputFormat
Output a single line to standard output (stdout): either "Conflict" if the new event overlaps with any existing event, or "No Conflict" if it does not.
## sample3
09:00 10:30
11:00 12:00
14:00 15:00
10:30 11:00
No Conflict