일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- compose
- composelifecycle
- jetpack
- 자바리스트정렬
- filternotnull()
- 티스토리챌린지
- programmers
- Dependency
- 자료형
- nullpointerexception방지
- 자바set
- 배열
- Java
- 리스트
- ContentProvider
- disposableeffect
- 파이썬
- android
- Python
- 자바
- 문자열
- 파이썬문법
- Kotlin
- 오블완
- 백준
- 프로그래머스
- Hilt
- Provider
- list
- 백준파이썬
Archives
- Today
- Total
목록파이썬 속도 개선 (1)
study gomi

내 제출 import sys # 명령의 수 n n = int(input()) # 정수를 저장하는 스택을 구현 stack = list() for _ in range(n): # 해야 할 명령을 정수 형태로 입력으로 받음. x = list(map(int, sys.stdin.readline().split())) # 1 X: 정수 X를 스택에 넣는다. (1 ≤ X ≤ 100,000) if x[0] == 1: stack.append(x[1]) # 2: 스택에 정수가 있다면 맨 위의 정수를 빼고 출력. 없다면 -1을 대신 출력한다. elif x[0] == 2: print(stack.pop() if stack else -1) # 3: 스택에 들어있는 정수의 개수를 출력한다. elif x[0] == 3: print(le..
Practice/Baekjoon
2024. 1. 12. 09:25