Merged
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.
🧷 문제 링크
https://www.acmicpc.net/problem/16168
🧭 풀이 시간
30분
👀 체감 난이도
✏️ 문제 설명
모든 지점을 지나면서 모든 연결 구간을 지나려고 한다.
같은 지점은 두 번 이상 지나도 되지만, 같은 경로는 두 번 이상 지날 수 없다.
원하는 노선이 가능한지 여부 구하기
🔍 풀이 방법
오일러 법칙 (한붓그리기)을 사용했다.
위의 2개의 법칙 중 하나를 만족하면 한붓 그리기가 가능하다.
이후, 모든 지점을 지나는지 여부를 bfs로 확인해 주었다. (union-find도 가능)
⏳ 회고
오일러 법칙을 알면 쉽게 풀었을 텐데, 알지 못해서 시간이 걸렸다.