글 작성 제목과 내용을 간결하게 정리해 주세요. 제목 내용 <h2>10828번</h2><pre><code class="language-python">import sys input = sys.stdin.readline stack = [] for i in range(int(input())): s = input() cmd = s[:2] if cmd == 'pu': stack.append(int(s[5:])) elif cmd == 'po': print(stack.pop()) if len(stack) > 0 else print(-1) elif cmd == 'si': print(len(stack)) elif cmd == 'em': print(0) if len(stack) > 0 else print(1) elif cmd == 'to': print(stack[len(stack)-1]) if len(stack) > 0 else print(-1) </code></pre> 글 종류 이론 정리 알고리즘 이론에 대한 정리글입니다. 문제 풀이 알고리즘 문제 풀이입니다. 알고리즘 분류 수정 취소