Skip to content

Conversation

@zinnnn37
Copy link
Contributor

@zinnnn37 zinnnn37 commented Sep 5, 2025

🧷 문제 링크

사회망 서비스(SNS)

🧭 풀이 시간

50분

👀 체감 난이도

✏️ 문제 설명

얼리어답터인 경우 depth 1의 자식에게 영향을 미칠 수 있음.
모든 노드가 영향을 받을 수 있는 최소한의 얼리어답터 수는?

🔍 풀이 방법

DP..

dp[ node ][ 0(일반인) / 1(얼리어답터) ]

내가 얼리어답터가 아닐 때 자식 중 최소 한 명은 얼리어답터여야 하니까 초기화를 1로 진행함. dp[cur][0] = 1

내가 얼리어답터면 자식이 얼리어답터일 필요가 없으니까 dp[child][0] 값을 더해주고
얼리어답터가 아니면 자식이 얼리어답터든 아니든 상관없어서 자식이 일반인일 때와 얼리어답터일 때를 비교해서 더 작은 값을 더해줌.

⏳ 회고

어려운 거 + 어려운 거

@ShinHeeEul ShinHeeEul merged commit a8b9317 into main Sep 5, 2025
1 check passed
@zinnnn37 zinnnn37 added the success 👍 해설을 보지 않고 풀었을 때 label Sep 5, 2025
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