-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path19583.py
More file actions
56 lines (39 loc) · 1.04 KB
/
19583.py
File metadata and controls
56 lines (39 loc) · 1.04 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
import sys
input = sys.stdin.readline
s, e, q = input().split()
sHour, sMinute = map(int, s.split(":"))
s = sHour * 60 + sMinute
eHour, eMinute = map(int, e.split(":"))
e = eHour * 60 + eMinute
qHour, qMinute = map(int, q.split(":"))
q = qHour * 60 + qMinute
attend = {}
while True:
try:
time, nickname = input().split()
if nickname in attend:
existTime = attend[nickname]
existTime.append(time)
attend[nickname] = existTime
else:
attend[nickname] = [time]
except:
break
result = 0
for nickname in attend:
before = False
end = False
if len(attend[nickname]) >= 2:
timeList = attend[nickname]
for time in timeList:
hour, minute = map(int, time.split(":"))
tempTime = hour * 60 + minute
if tempTime <= s:
before = True
if e <= tempTime <= q:
end = True
if before and end:
result += 1
else:
continue
print(result)