| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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
- cpp
- All Longest Strings
- Numpy
- markdown
- adjacentElementsProduct
- collections.deque
- flask
- 10953
- centuryFromYear
- 2015 봄학기 알고리즘
- 파이썬 포렌식
- C++
- Sequential Search
- codesignal
- 백준
- matrixElementsSum
- recursion
- codesingal
- Python
- 피보나치 수
- til
- data_structure
- baekjun
- almostIncreasingSequence
- 파이썬머신러닝완벽가이드
- Daily Commit
- Counting cells in a blob
- shapeArea
- 2750
- 수 정렬하기
Archives
- Today
- Total
목록deque 1
Introfor
[백준] 10866번 덱
from sys import stdin from collections import deque if __name__ == '__main__': n = int(stdin.readline()) Deque = deque() for _ in range(n): cmd = stdin.readline().split() if cmd[0] == 'push_front': Deque.appendleft(cmd[1]) elif cmd[0] == 'push_back': Deque.append(cmd[1]) elif cmd[0] == 'pop_front': if len(Deque) == 0: print(-1) else: print(Deque.popleft()) elif cmd[0] == 'pop_back': if len(Deque..
카테고리 없음
2020. 9. 12. 21:08