Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- line_1 = set([int(x) for x in input().split()])
- line_2 = set([int(y) for y in input().split()])
- num_of_commands = int(input())
- for i in range(num_of_commands):
- commands = input().split()
- operation = commands[0]
- num_of_line = commands[1]
- sequence = [(int(x)) for x in commands[2:]]
- if operation == 'Add' and num_of_line == 'First':
- line_1 = line_1.add(sequence)
- elif operation == 'Add' and num_of_line == 'Second':
- [line_2.add(int(x)) for x in commands[2:]]
- elif operation == 'Remove' and num_of_line == 'First':
- line_1 = line_1.difference(sequence)
- elif operation == 'Remove' and num_of_line == 'Second':
- line_2 = line_2.difference(sequence)
- elif operation == 'Check Subset':
- if line_2.issubset(line_1) or line_1.issubset(line_2):
- pass
- print(line_2.issubset(line_1) or line_1.issubset(line_2))
- print(*line_1)
- print(*line_2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement