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