Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- res = []
- for _ in range(int(input())):
- a = [int(i) for i in input().split()]
- ok = True
- for i in res:
- if a[0] == i[0]:
- i.extend(a[1:])
- ok = False
- if ok :
- res.append(a)
- for i in range(len(res)):
- res[i] = tuple(res[i])
- print(res)
- '''
- 4
- 5 6
- 5 7
- 5 8
- 6 5 8 7
- 3
- 6 7
- 6 10
- 6 8
- '''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement