Skip to content

Conversation

@JHLEE325
Copy link
Contributor

🧷 문제 링크

https://www.acmicpc.net/problem/16562

🧭 풀이 시간

30분

👀 체감 난이도

✏️ 문제 설명

친구비를 통해서 친구를 사귀는 준석이가
친구의 친구는 친구다 라는 논리로 친구를 가성비 있게 만들려고 할 때
주어지는 모든 사람을 친구로 만들 때 필요한 최소비용을 구하는 문제입니다.
만약 모두 친구가 될 수 없다면 oh no 라고 출력합니다.

🔍 풀이 방법

bfs를 이용해서 방문하지 않은 노드를 방문하면서
한 묶음에 대한 최소 비용을 도출해서 각각 더했습니다.

⏳ 회고

간단한 그래프 탐색 문제였습니다.

@JHLEE325 JHLEE325 added the success 👍 해설을 보지 않고 풀었을 때 label Dec 10, 2025
@ShinHeeEul ShinHeeEul merged commit 6c73f41 into main Dec 10, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

success 👍 해설을 보지 않고 풀었을 때

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants