Skip to content

Conversation

@Seol-JY
Copy link
Contributor

@Seol-JY Seol-JY commented Jun 15, 2025

🧷 문제 링크

https://www.acmicpc.net/problem/12851

🧭 풀이 시간

30분

👀 체감 난이도

✏️ 문제 설명

수빈이는 걷거나 순간이동할 수 있는데, 걷는 경우 1초 후에 위치가 X-1 혹은 X+1로 이동하며, 순간이동은 1초 후에 위치가 2*X가 된다.
수빈이가 동생을 찾는 가장 빠른 시간과, 그 시간으로 찾는 방법의 수를 구하는 문제

🔍 풀이 방법

BFS를 사용해 각 위치에 도달하는 최소 시간을 구함
visited 배열에는 해당 위치를 방문한 최소 시간을 기록하며, 같은 최소 시간에 여러 경로가 도달할 수 있으므로, 이를 처리하기 위해 visited[next] == time + 1인 경우도 큐에 넣어 방법 수 세기
동생 위치에 도달할 때마다 최소 시간을 갱신하거나, 같은 시간에 도달하면 방법 수를 증가

⏳ 회고

최소 시간과 경로 수 한번에 구하는 문제, 생각보다 햇갈렸지만 크게 어려운 건 없었음

@Seol-JY Seol-JY self-assigned this Jun 15, 2025
@Seol-JY Seol-JY added the success 👍 해설을 보지 않고 풀었을 때 label Jun 15, 2025
@ShinHeeEul ShinHeeEul merged commit c233076 into main Jun 15, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

success 👍 해설을 보지 않고 풀었을 때

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants