Study/알고리즘 썸네일형 리스트형 [BOJ]9012 괄호 - python https://www.acmicpc.net/problem/9012 스택을 이용한 기초적인 문제로 코드는 다음과 같습니다. 123456789101112131415161718192021222324252627282930313233import collectionsimport sys def is_vps(x): stack = collections.deque() for i in x: if i == "(": stack.append(i) else: if len(stack) == 0: return False else: stack.pop() if len(stack) == 0: return True return False T = int(input()) for _ in range(T): ip = sys.stdin.readlin.. 이전 1 2 다음