This repository was archived by the owner on Mar 18, 2024. It is now read-only.
[2023-10-09] sumin #313#327
Merged
Merged
Conversation
Woo-Yeol
approved these changes
Oct 9, 2023
Member
Woo-Yeol
left a comment
There was a problem hiding this comment.
현재 위치에 대한 관점으로 백 트래킹을 진행하였을 때 지금처럼 진행 될 수 있음을 알게된 것 같아서 도움이 많이 되었습니다! 고생하셨어요 수민님!
Member
There was a problem hiding this comment.
방문처리를 다음에 탐색할 영역이 아닌 현재 방문한 위치에 대해서 방문 처리 및 방문 처리 해제를 해주는 과정이 인상 깊네요!
Contributor
There was a problem hiding this comment.
저도 사실 ny와 nx를 다룰 때 방문 처리를 하는게 익숙해서 잘 와닿지 않았던 것 같아요! 하지만 이렇게 훨씬 깔끔하게 구성할 수 있다는 것을 알았습니다!
zsmalla
approved these changes
Oct 9, 2023
Contributor
zsmalla
left a comment
There was a problem hiding this comment.
백트래킹 문제를 풀 때 여러 방법으로 풀어서 수민님처럼 깔끔하게 풀이하는 노하우 익혀보도록 하겠습니다! 고생하셨습니다 수민님~
Contributor
There was a problem hiding this comment.
저도 사실 ny와 nx를 다룰 때 방문 처리를 하는게 익숙해서 잘 와닿지 않았던 것 같아요! 하지만 이렇게 훨씬 깔끔하게 구성할 수 있다는 것을 알았습니다!
limstonestone
approved these changes
Oct 9, 2023
Contributor
limstonestone
left a comment
There was a problem hiding this comment.
제 풀이에서 조금 더 직관적인 풀이인것 같아요 ..ㅎ
잘 이해할 수 있었습니다 감사합니다~!
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
PR Summary
풀이시간: 40분
<input>
n: 격자의 크기(2 ≤ n ≤ 4)
m: 순서대로 방문해야 하는 칸의 수(2 ≤ m ≤ n^2)
n개의 수(0 or 1)
방문해야할 m개의 칸 (x, y)가 주어진다
<solution>
n과 m이 매우 작기 때문에 DFS를 통해 모든 경우의 수를 확인한다.(브루트 포스)
이 때, 더 이상 다음 칸으로 이동할 수 없다면 탐색을 포기한다.(백트래킹)
<시간복잡도>
O(N^2)