Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1. n = int(input())
  2. day = 24 * 60
  3. times = []
  4. for i in range(n):
  5.     ex = list(map(int, input().replace(':', ' ').split()))
  6.     #print(ex)
  7.     times.append((ex[0] * 60 + ex[1] + ex[2]) % day)
  8.     #print(times)
  9. times.sort()
  10. for i in times:
  11.     hours =  str(i // 60)
  12.     mins = str(i % 60)
  13.     if len(hours) == 1:
  14.         print('0' + hours, end=':')
  15.     else:
  16.         print(hours, end=':')
  17.     if len(mins) == 1:
  18.         print('0' + mins)
  19.     else:
  20.         print(mins)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement