Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[미라] 250326 #144

Merged
merged 2 commits into from
Mar 27, 2025
Merged

[미라] 250326 #144

merged 2 commits into from
Mar 27, 2025

Conversation

ssum1ra
Copy link
Member

@ssum1ra ssum1ra commented Mar 26, 2025

🍳 Algorithm approach and solution

풀이 과정

  • dfs 활용
    • 그리디하게 탐색 (사전 순으로 먼저 이동)
    • 조건
      • 현재 위치에서 남은 거리가 맨허튼 거리보다 짧다면, 가지치기
      • 현재 위치에서 남은 거리를 맨허튼 거리로 뺀 수가 홀수라면, 가지치기
        • image
        • k = 4일 때, 맨허튼 거리는 3이다.
        • k가 홀수일 경우와 짝수일 경우를 생각해보자.
      • 남은 거리가 0이고 도착 지점에 도달했다면, 정답

풀이 시간

  • 1시간 20분 ~ 30분 쯤?

@ssum1ra ssum1ra merged commit 1231e6d into main Mar 27, 2025
@ssum1ra ssum1ra deleted the 미라/250326 branch March 31, 2025 01:43
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.

1 participant