Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def cin():
- return list(map(int, input().split()))
- ans = True
- t = int(input())
- n = int(input())
- cnt = [0 for x in range(100000)]
- d = cin()
- for x in range(t):
- r = cin()
- s = sum(r)
- bar = []
- for i in range(s):
- tmp = cin()
- if len(bar) != 0:
- # ToDo: add formula
- pass
- for j in tmp:
- if j > s:
- ans = False
- break
- for j in tmp:
- cnt[j] += 1
- if cnt[j] > 1:
- ans = False
- break
- bar = tmp
- if not ans:
- print('No')
- ans = True
- continue
- for j in range(1, s + 1):
- if cnt[j] != 1:
- ans = False
- break
- if not ans:
- print('No')
- ans = True
- continue
- print("Yes")
- cnt = [0 for x in range(100000)]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement