Skip to content

[Week08] BOJ 13549: 숨바꼭질 3#57

Merged
sukangpunch merged 1 commit intomainfrom
sukangpunch
Mar 9, 2026
Merged

[Week08] BOJ 13549: 숨바꼭질 3#57
sukangpunch merged 1 commit intomainfrom
sukangpunch

Conversation

@sukangpunch
Copy link
Contributor

@sukangpunch sukangpunch commented Feb 27, 2026

문제 정보

풀이 방법

간단히 어떤 방식으로 풀었는지 설명해주세요.

예시:
 메모리 초과 이슈로 시간이 오래 걸렸다. 
 현재 위치 N 에서 K까지 가는 최소의 경우를 구하면 된다. N과 K 의 위치가 동적이기 때문에 dp 배열을 선언할 때, 문제에서 모든 값을 처리 가능한 배열 사이즈로 초기화 현재 위치에서 x2 를 하는 방식이 최소 이동 방식이기 때문에 먼저 진행한다. 
 배열 범위 내에서 x2 가 가능하다면 dp 를 업데이트하고 큐에 넣는다. 
 -1 과 1 은 cost가 1 증가하므로 이를 고려하여 dp 를 업데이트하고 q에 넣는다. 
 q에서 꺼낸 Point가 K와 같다면 현재 cost를 출력하고 종료한다.

체크리스트

  • 코드가 정상적으로 실행되나요?
  • 커밋 메시지가 컨벤션을 따르나요?
  • 파일명이 올바른가요? ({닉네임}.{확장자})

추가 코멘트

(선택사항) 추가로 공유하고 싶은 내용이 있다면 작성해주세요.

@sukangpunch sukangpunch self-assigned this Feb 27, 2026
@github-actions github-actions bot added weekly-challenge 주차별 공통 문제 백준 백준 문제 labels Feb 27, 2026
@sukangpunch sukangpunch merged commit 33df3a9 into main Mar 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

weekly-challenge 주차별 공통 문제 백준 백준 문제

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant