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