Skip to content

Conversation

@suyeun84
Copy link
Contributor

🧷 문제 링크

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

🧭 풀이 시간

40분

👀 체감 난이도

✏️ 문제 설명

가족 정보가 주어지고,
왕위 후보들 중에서 왕과 혈통이 가장 가까운 사람을 출력한다.

🔍 풀이 방법

왕위 후보의 혈통 정보가 HashMap에 저장되어 있지 않으면,
DFS를 이용해서 각 부모의 혈통 정보를 가져와서 HashMap에 저장한 후, answer 초기화

⏳ 회고

dfs를 사용할 때는 재귀를 탈출하는 조건을 더 상세히 설정해두어야 할 것 같다..

@suyeun84 suyeun84 added the success 👍 해설을 보지 않고 풀었을 때 label Feb 13, 2025
@ShinHeeEul ShinHeeEul merged commit 71e958b into main Feb 13, 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