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