Skip to content

Conversation

@suyeun84
Copy link
Contributor

🧷 문제 링크

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

🧭 풀이 시간

20분

👀 체감 난이도

✏️ 문제 설명

트리가 주어졌을 때, 노드 한개를 제거하려고 함
노드를 지웠을 때, 리프 노드의 개수 구하기

🔍 풀이 방법

부모에 자식을 graph 배열에 저장하고, poss배열로 해당 노드가 지워졌는지 판단
이후, poss인 노드를 하나도 가지지 않은 노드들이 leaf 노드임

⏳ 회고

나는 그냥 구현으로 풀었는데, 다들 dfs로 풀었따. dfs가 더 좋은 방법인듯~

@suyeun84 suyeun84 self-assigned this Oct 27, 2025
@suyeun84 suyeun84 added the success 👍 해설을 보지 않고 풀었을 때 label Oct 27, 2025
@suyeun84 suyeun84 merged commit 2c5bebb into main Oct 27, 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.

2 participants