문제1627--AAAAHH! Overbooked!

1627: AAAAHH! Overbooked!

실행시간 제한: 10 Sec  메모리사용 제한: 256 MB
제출: 39  통과: 21
[제출] [채점기록] [묻고답하기]

문제 설명

Elaine is excited to begin the school year—so excited, in fact, that she signed herself up to attend several events today (This programming contest, sadly, is not one of them). She may have overdone it, though; she didn’t bother to check whether the events she signed up for have conflicting times. While you’re sitting here in this contest, why not check for her?

입력 설명

 The input consists of multiple test cases. Each test case begins with an integer N, 1 ≤ N ≤ 100, on a line by itself denoting the number of events. After that follow N lines giving the start and end times of each event, in hh:mm-hh:mm 24-hour format. The end time is guaranteed to be strictly after the start time. Input is followed by a single line with N = 0, which should not be processed.

출력 설명

 For each test case, print out a single line that says “conflict” (no quotes) if Elaine’s events have conflicting times, and “no conflict” (no quotes) otherwise. Assume that Elaine can travel around campus instan- taneously, so if an event starts at the same time another event ends, the two events do not conflict.

입력 예시 Copy

3
09:00-09:50
13:00-17:00
09:50-10:30
2
10:00-11:00
09:00-12:00
0

출력 예시 Copy

no conflict
conflict

출처/분류