Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BFS문제임을 알아채고 바로 문제를 풀어서 20분만에 테케를 통과시켰는데 히든테케에서 시간초과가 나는 바람에 시간이 지체됐습니다처음엔
x를 시작점으로 두고y가 될 때까지 접근하면서x가y보다 커지는 경우만continue하는 방식으로 풀었는데 시간초과가 4개나 나올 정도로 효율이 정말 좋지 않았고다음엔
y를 시작점으로 두고x가 될 때까지 접근하면서y가 나누어 떨어지지 않거나 0 미만으로 내려가는 경우는queue에 값을 담지 않는 식으로 시행횟수를 줄여 히든테케 10번만 시간초과되는 수준까지 효율을 올렸습니다분명 반복 시행되는 부분이 있을거라 생각하고 고민하다가
visited로 이미 접근했던 숫자는 다시 계산하지 않는 방법으로 통과했습니다!