728x90 집합1 [python] 백준 11723 집합 https://www.acmicpc.net/problem/11723 11723번: 집합 첫째 줄에 수행해야 하는 연산의 수 M (1 ≤ M ≤ 3,000,000)이 주어진다. 둘째 줄부터 M개의 줄에 수행해야 하는 연산이 한 줄에 하나씩 주어진다. www.acmicpc.net 문제 해결 집합의 연산에 대해서 확인 할 수 있는 기본적 문제라 생략. CODE import sys input = sys.stdin.readline M = int(input()) S = set() for _ in range(M): command = input().split() if command[0] == 'add': S.add(int(command[1])) elif command[0] == 'remove': try: S.remov.. 2023. 1. 18. 이전 1 다음 728x90