Skip to content
Discussion options

You must be logged in to vote

해결은 하셨나요??

저도 같은 문제를 풀다가 메모리 초과 때문에 고생을 좀 했습니다...

우선 저는 최단 경로를 역추적해서 지우는 과정을 bfs로 했는데 한 2시간 정도 고민하다가

동일한 정점일 계속 push하는 것 때문에 생기는 것을 확인 했습니다...

정훈님은 remove 함수를 dfs로 구현하셨는데 visited 배열을 하나 만들어서 동일 정점을 계속 호출하는 것을 한 번 막아보시는 게 어떨까요?

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@wjdgns7712
Comment options

wjdgns7712 Aug 13, 2021
Maintainer Author

@YeonsangYoon
Comment options

Comment options

You must be logged in to vote
1 reply
@YeonsangYoon
Comment options

Answer selected by wjdgns7712
Comment options

You must be logged in to vote
1 reply
@wjdgns7712
Comment options

wjdgns7712 Aug 16, 2021
Maintainer Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants