백준 2493 (1) 썸네일형 리스트형 [ BOJ / 파이썬 ] 2493 탑 이 문제가 스택 유형이라는 것을 알고 있어서 쉽게 풀 수 있을 것 같다는 생각을 했다. 혼자였으면 스택이라는 것도 파악 못 할 뻔 했어서 그걸 아니까 조금 자신감이 생긴 느낌이었다. / 제출 1 / import sys input = sys.stdin.readline n = int(input()) towers = list(map(int, input().split())) result = [] while towers: current = towers.pop() remains = len(towers) while remains > 0: if towers[remains-1] >= current: break remains -= 1 result.append(remains) while result: print(result.. 이전 1 다음