일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 프로그래머스
- 자바set
- 자바리스트정렬
- Provider
- composelifecycle
- filternotnull()
- 문자열
- 파이썬
- android
- 오블완
- Dependency
- 백준파이썬
- jetpack
- 파이썬문법
- 백준
- Kotlin
- ContentProvider
- list
- Java
- programmers
- 자바
- Hilt
- compose
- 배열
- disposableeffect
- Python
- 티스토리챌린지
- nullpointerexception방지
- 자료형
- 리스트
Archives
- Today
- Total
목록파이썬덱 (1)
study gomi

내 제출 import sys from collections import deque # 명령의 수 N이 주어진다 (1 ≤ N ≤ 1,000,000) n = int(input()) deque = deque() # n 개의 줄에 명령이 하나씩 주어진다. for _ in range(n): command = list(map(int, sys.stdin.readline().split())) if command[0] == 1: deque.appendleft(command[1]) elif command[0] == 2: deque.append(command[1]) elif command[0] == 3: print(deque.popleft() if deque else -1) elif command[0] == 4: print..
Practice/Baekjoon
2024. 1. 16. 01:34