Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def konw(m):
- h=0
- minu=m
- while minu>=60:
- minu-=60
- h+=1
- return h,minu
- nazwy={}
- minuty={}
- godziny={}
- x,y = input().split()
- x=int(x)
- y=int(y)
- for i in range(x):
- s = input()
- s = list(s)
- s.pop(-1)
- s = ''.join(s)
- s = s.split()
- nazw=s[3]
- s = s[-4] + " " + s[-3] + " " + s[-1]
- minuty[s]=0
- godziny[s]=0
- nazwy[nazw]=s
- for i in range (y):
- x = input().split()
- h = x[3]
- h = h.split(":")
- god=int(h[0])
- minu=int(h[1])
- op=int(x[-2])
- poc = x[8] + " " + x[9] + " " + x[11]
- czas=(god*60)+minu+op
- if poc in godziny:
- if godziny[poc]==0:
- godziny[poc]=czas
- else:
- if czas>godziny[poc]:
- godziny[poc]=czas
- for i in sorted (nazwy.keys()) :
- godz,minut=konw(godziny[nazwy[i]])
- godz=str(godz)
- minut=str(minut)
- if len(godz)==1:
- godz="0"+godz
- if len(minut)==1:
- minut="0"+minut
- print(godz+":"+minut)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement