Skip to content

Conversation

@beberiche
Copy link
Contributor

No description provided.

@github-actions
Copy link

github-actions bot commented Apr 8, 2024

솔루션을 올려주셔서 감사합니다.
아래 정보가 맞는지 확인해주세요.

문제 링크: https://www.acmicpc.net/problem/13265

작성자: beberiche
언어: Java
사이트: baekjoon
풀이 설명: 
1. 그래프 응용 문제. 주어진 입력값을 통해 그래프를 형성하여 탐색했을 때,
   인접 노드끼리 색이 다른지 확인하는 방식으로 문제를 풀 수 있다.

2. 해당 풀이의 경우 색의 상태값을 \`0,1,-1\` 로 정했다.
   \`0\` 은 색이 칠해지지 않은 경우, \`1,-1\` 은 각각 색을 칠한 경우이며 색이 서로 다르다고 가정했다.
   만약 임의의 노드의 색을 \`c\` 라고 한다면, 다음 이동해야할 노드의 색은 \`c*-1\` 이어야 한다.

3. 그래프 탐색 중, 현재 노드와 다음 노드의 색이 동일한 경우가 발생한다면 \`impossible\` 을,
   탐색이 끝날때 까지 발생하지 않는다면 \`possible\` 을 출력한다.


@github-actions github-actions bot added Java Java solution 솔루션 PR baekjoon baekjoon labels Apr 8, 2024
Copy link
Owner

@tony9402 tony9402 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tony9402 tony9402 merged commit c701860 into tony9402:main Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants