f | import time | f | import time |
| | | |
n | def sort_key(record): | n | def sort_key(row): |
| return (record[0], record[1][1], record[1][0], record[1][2]) | | return [row[0], row[1][1], row[1][0], row[1][2]] |
| record = input().split() | | inpt = input().split() |
| records = [] | | lst = [] |
| while record: | | while inpt: |
| records.append([time.strptime(record[-1], '%H:%M:%S'), [record[0], record[1], ' '.join(record[2:len(record) - 1]), record[-1]]]) | | lst.append([time.strptime(inpt[-1], '%H:%M:%S'), [inpt[0], inpt[1], ' '.join(inpt[2:len(inpt) - 1]), inpt[-1]]]) |
| record = input().split() | | inpt = input().split() |
| records.sort(reverse=False, key=sort_key) | | lst.sort(reverse=False, key=sort_key) |
| output = [records[0][1]] | | res = [lst[0][1]] |
| num = 0 | | cnt = 0 |
| idx = 0 | | idx = 0 |
n | while idx < len(records) - 1 and num < 3: | n | while idx < len(lst) - 1 and cnt < 3: |
| idx += 1 | | idx += 1 |
n | if records[idx][0] != records[idx - 1][0]: | n | if lst[idx][0] != lst[idx - 1][0]: |
| num += 1 | | cnt += 1 |
| if num < 3: | | if cnt < 3: |
| output.append(records[idx][1]) | | res.append(lst[idx][1]) |
| lengths = [0] * len(output[0]) | | lengths = [0] * len(res[0]) |
| for row in output: | | for row in res: |
| for i in range(len(row)): | | for i in range(len(row)): |
| if len(row[i]) > lengths[i]: | | if len(row[i]) > lengths[i]: |
| lengths[i] = len(row[i]) | | lengths[i] = len(row[i]) |
n | for row in output: | n | for row in res: |
| for i in range(len(row)): | | for i in range(len(row)): |
t | print('{:<{width}}'.format(row[i], width=lengths[i]), end=' ') | t | print('{:<{prec}}'.format(row[i], prec=lengths[i]), end=' ') |
| print() | | print() |