Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if __name__ == '__main__':
- N_Q = input().split(' ')
- N = int(N_Q[0])
- Q = int(N_Q[1])
- str_facts = []
- for i in range(Q):
- str_facts.append(input().split(' '))
- facts = [[0] * 2 for i in range(Q)]
- for i in range(Q):
- facts[i][0] = int(str_facts[i][0]) - 1
- facts[i][1] = int(str_facts[i][1]) - 1
- is_contains = False
- for i in range(N):
- is_contains = False
- for j in range(Q):
- if i in facts[j]:
- is_contains = True
- if is_contains:
- print("Yes")
- else:
- print("No")
Add Comment
Please, Sign In to add comment