Skip to content

[BOJ 13913] 숨바꼭질 4 - #66

Merged
sh0723 merged 1 commit into
mainfrom
solve-boj13913
Jun 19, 2026
Merged

sh0723 merged 1 commit into
mainfrom
solve-boj13913

Conversation

@sh0723

@sh0723 sh0723 commented Jun 19, 2026

Copy link
Copy Markdown
Owner

풀이 요약

  • BFS로 0부터 100000 사이의 위치를 탐색하면서 각 위치의 최초 방문 시간을 기록했습니다.
  • 다음 위치를 처음 방문할 때 직전 위치를 parent[next]에 저장해 최단 경로를 복원할 수 있게 했습니다.
  • 동생 위치에 도달하면 BFS를 종료하고, parent를 거슬러 올라간 뒤 스택으로 뒤집어 시작점부터 도착점까지 출력했습니다.

Link

https://velog.io/@sh0723/PS-%EB%B0%B1%EC%A4%80-13913%EB%B2%88-%EC%88%A8%EB%B0%94%EA%BC%AD%EC%A7%88-4

문제

  • BOJ 13913
  • 제목: 숨바꼭질 4

Closes #65

@sh0723
sh0723 merged commit 33e346f into main Jun 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BOJ 13913] 숨바꼭질 4

1 participant