일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- C++
- centuryFromYear
- Sequential Search
- Numpy
- Counting cells in a blob
- 파이썬머신러닝완벽가이드
- recursion
- almostIncreasingSequence
- collections.deque
- 피보나치 수
- 파이썬 포렌식
- 수 정렬하기
- cpp
- codesingal
- 10953
- til
- 2750
- Daily Commit
- All Longest Strings
- Python
- matrixElementsSum
- adjacentElementsProduct
- markdown
- 2015 봄학기 알고리즘
- flask
- baekjun
- codesignal
- shapeArea
- data_structure
- 백준
Archives
- Today
- Total
목록덱 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