Skip to content

Conversation

jewan100
Copy link
Contributor

No description provided.

Comment on lines +9 to +20
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dist에 진짜 떨어진 거리를 저장하는게 아니라 선후관계를 저장하면 되군요?,,,, 아하,,, !!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

맞습니다! 그래서 풀어보면 좋은 문제 리스트에 이 문제 넣어놨었는데
제출돼서 반가웠어여 ㅋㅋㅋㅋ

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이부분 질문이 있는데요!
dist[i][p] == dist[p][j] i → j 로 경유 할때 왜 dist[i][p]dist[i][j] 로.. 들어가는건가요...!?

i → p와 p → j가 동일하다면 i → j도 동일한 상태를 가짐

이건 이해를 했어요.. 근데 dist[i][j] = dist[i][p]; 가 어떤 관계인지 잘 이해가 안가는데 설명해주실수있을까요?🥺


풀어보면 좋은 문제 리스트에 이 문제 넣어놨었는데

제완님 위시리스트 같아서 참고했죠ㅎㅎ

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아! dp[i]][j]에 들어가는 값은 dp[i][p]이든 dp[p][j]든 상관 없습니다!
어차피 같은 상태를 저장하고 있기 때문에 둘 중 아무 값이나 넣어준겁니다 ㅎ
p를 경유했는데 dp[i][p]dp[p][j]가 같은 값을 갖고 있다는 것은 dp[i][j]의 상태를 결정하기에 충분하기 때문입니도

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오호 이거 진짜 똑똑한 생각인것 같아요!! 선후관계를 넣는 것!! 😮

@jewan100 jewan100 merged commit 6fb85b3 into GreatAlgorithm-Study:main Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants