1
2
3
4
5
6
7
8
9
|
t,n=map(int,input().split())
days=["Mon","Tue","Wed","Thu","Fri"]
for _ in range(n):
tmp=list(input().split())
if tmp[0]==tmp[2]: t-= int (tmp[3])- int(tmp[1])
else: t-= 24*(days.index(tmp[2])-days.index(tmp[0]))+int(tmp[3])-int(tmp[1])
if t>48: print(-1)
elif t>0:print(t)
elif t>-49 : print(0)
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
[백준] 19946 (0) | 2021.01.20 |
---|---|
[백준] 19945 (0) | 2021.01.19 |
[백준] 19563 (0) | 2021.01.19 |
[백준] 19532 (0) | 2021.01.19 |
[백준] 18795 (0) | 2021.01.19 |
댓글