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
- C++
- Reinforcement Learning
- LSTM
- 백준
- Mask Processing
- dfs
- DP
- dynamic programming
- image processing
- 딥러닝
- object detection
- canny edge detection
- 머신러닝
- 그래프 이론
- Python
- two-stage detector
- real-time object detection
- r-cnn
- AlexNet
- machine learning
- CNN
- 강화학습
- eecs 498
- MySQL
- BFS
- MinHeap
- opencv
- One-Stage Detector
- deep learning
- YoLO
Archives
- Today
- Total
목록heapq (1)
JINWOOJUNG

접근법 최소 비교 횟수를 구하기 위해서는 입력받은 묶음의 크기를 정렬한 후 작은 2개의 묶음의 크기부터 더해나가서 계산할 수 있다. 따라서 양쪽으로 입출력이 가능한 deque 자료구조를 사용하여 구현하였다. from collections import deque N = int(input()) tmp = [] for i in range(N): tmp.append(int(input())) tmp.sort() queue = deque() for i in range(N): queue.append(tmp[i]) result = 0 for _ in range(1,N): a = queue.popleft() b = queue.popleft() result += a+b queue.appendleft(a+b) print(r..
백준
2023. 12. 28. 16:29