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

접근법 dfs를 활용하여 접근하였고, 방문하지 않은 노드에 대하여 dfs를 적용한다면, 연결된 노드들을 방문하고 만약 연결이 안된 다른 그룹이 있다면, 연결 요소의 개수를 증가시키고 다시 dfs를 적용시키면 된다. 정답 import sys sys.setrecursionlimit(10**9) M, N= map(int, sys.stdin.readline().split()) visited = [False]*(M+1) graph = [[]for _ in range(M+1)] for _ in range(N): x, y = map(int, sys.stdin.readline().split()) graph[x].append(y) graph[y].append(x) def dfs(start): visited[start] ..
백준
2024. 1. 2. 19:57