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 | 31 |
Tags
- WSGI
- ebs
- leetcode
- Kubernetes
- Python
- EC2
- Deployment
- ansible
- EKS
- terraform
- POD
- event loop
- asyncio
- YAML
- 자바스크립트
- docker
- AWS
- elasticsearch
- github
- s3
- dockerfile
- Django
- IAM
- Service
- asgi
- 안드로이드
- K8S
- IAC
- intervals
- FastAPI
Archives
- Today
- Total
목록priority_queue (1)
궁금한게 많은 개발자 노트
[ leetcode ] 1046. Last Stone Weight
우선순위 큐를 사용하여 가장 큰 두 돌을 꺼내 같으면 둘 다 제거하고, 차이가 있다면 큰 돌의 무게에서 작은 돌의 무게를 빼서 다시 큐에 넣어 마지막 남은 돌의 무게를 반환하는 문제입니다. 만약 모두 제거되었다면 0을 반환합니다. #define swap(a,b,t)((t) = (a), (a) = (b), (b) = (t)) class Solution { public: int heap[31] = {0,}; int heap_size = 0; void insert_heap(int item) { heap[++heap_size] = item; int current = heap_size; int temp; while (current /2 >= 1 && heap[current] > heap[current/2]) { ..
Algorithm
2023. 5. 2. 11:01