[20251219] BOJ / G3 / 소가 길을 건너간 이유 6 / 한종욱#1711
Merged
ShinHeeEul merged 1 commit intomainfrom Dec 19, 2025
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/14466
🧭 풀이 시간
25분
👀 체감 난이도
✏️ 문제 설명
소가 길을 건너지 않고 만날 수 있는 쌍의 개수는?
🔍 풀이 방법
주어진 길은 사실 건너면 안되는 것이기 때문에, 각 목초지마다 배열을 만들어 진행 방향을
true,false로 풀었다.그 설정만 하고 소들을 하나씩 탐색하면서 다른 소들과 만나는 개수를 측정한다.
한번 탐색한 소를 사라지게 하면 중복 측정을 막을 수 있다.
⏳ 회고
오랜만에 간단한 BFS에 생각 한 스푼의 문제라 재밌었다.