24931 [백준 2493번] 탑 n = int(input()) tops = list(map(int,input().split())) answer = [0 for _ in range(n)] stack = [] for i,value in enumerate(tops): while stack: if stack[-1][1] 2023. 8. 29. 이전 1 다음