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