-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClashing Events
More file actions
59 lines (50 loc) · 1.94 KB
/
Copy pathClashing Events
File metadata and controls
59 lines (50 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
'''Everyone who is involved with HackerEarth in what so ever form knows who Little Kuldeep is. He's not so little, but he's called that. (No one knows why!) He's pretty efficient at organizing, mentoring, managing various hiring challenges, contests happening on HackerEarth all the time. But age has caught up with him, finally. He's turned into little, old Kuldeep from little Kuldeep.
Earlier, he could've handled multiple contests like a piece of cake, but it is not possible for him now. In the present scenario, he needs other people to moderate contests, because he's busy moderating some other contest which is happening at the same time.
Given the timings of the contests happening, can you check and tell little, old Kuldeep if he would need a moderator to help him out, or not?
Input format:
The input starts with a number, t, denoting the number of contests in a single day. On the next n lines, the time at which a contest starts and finishes is given.
Output format:
For every case, you need to print a single line stating "Will need a moderator!" if contests are clashing, or "Who needs a moderator?" if the events are NOT clashing.
Constraints:
1 <= N <= 100
Time will be given in HoursHours:MinutesMinutes format. (HH:MM)
The end time will (Surely!) be after the start time.
Example Input:
2
09:30-11:00
11:00-12:00
Example Output:
Who needs a moderator?
SAMPLE INPUT
2
11:00-13:30
13:00-13:45
SAMPLE OUTPUT
Will need a moderator!
'''
#My Solution
t=int(input())
s=[]
e=[]
for i in range(t):
st,en=input().split("-")
sth,stm=st.split(":")
enh,enm=en.split(":")
sth=int(sth)
stm=int(stm)
enh=int(enh)
enm=int(enm)
s.append(((sth*60)+stm))
e.append(((enh*60)+enm))
fl=0
for i in range(t):
for j in range(t):
if j==i: continue
else:
if s[i]>s[j] and s[i]<e[j]:
fl+=1
break
if fl==0:
print("Who needs a moderator?")
else:
print("Will need a moderator!")