Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- N과M
- BFS
- dfs
- MYSQL
- dict
- 파이썬
- 가상메모리
- python
- 그리디
- 딕셔너리
- level3
- level2
- BOJ
- 다이나믹 프로그래밍
- 수학
- 브루트포스
- DP
- programmers
- level0
- 프로그래머스
- 다익스트라
- 운영체제
- 백준
- 스택
- 가상메모리 관리
- 재귀
- 구현
- level1
- 코딩테스트
- 힙
Archives
- Today
- Total
목록이중우선순위큐 (1)
동캄의 코딩도장
프로그래머스 level3 [이중우선순위큐] 파이썬
https://programmers.co.kr/learn/courses/30/lessons/42628 코딩테스트 연습 - 이중우선순위큐 programmers.co.kr # 프로그래머스 이중우선순위큐 import heapq def solution(operations): answer = [] heap = [] for operation in operations: oper, digit = map(str, operation.split()) if oper == 'I': heapq.heappush(heap, int(digit)) elif heap and oper == 'D' and digit == '1': heap = heapq.nlargest(len(heap), heap)[1:] heapq.heapify(heap)..
코테/프로그래머스
2022. 4. 7. 21:18