Skip to content

Conversation

@oncsr
Copy link
Contributor

@oncsr oncsr commented Oct 21, 2025

🧷 문제 링크

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

🧭 풀이 시간

60분

👀 체감 난이도

✏️ 문제 설명

(0,0)에서 출발하여 상하좌우 중 하나로 구성된 길이 N의 이동 명령을 따라 이동한다.
도착점이 (x,y)가 되기 위해 수정해야 하는 이동 명령의 최솟값을 Q번 구해보자.

🔍 풀이 방법

새로운 도착점 (x,y)는 원래의 도착점 (X,Y)와 체스판 상에서 다른 색 칸에 위치한다면 절대 이동할 수 없다.
또, |x| + |y|가 N보다 크면 어떻게 수정해도 이동할 수 없다.
위 두 경우를 배제하면 답은 (|x-X| + |y-Y|) / 2라고 생각했다.

⏳ 회고

근데 답이 저게 아닌가보다. 왜 아니지? 반례도 못 찾겠음

@oncsr oncsr self-assigned this Oct 21, 2025
@oncsr oncsr added the fail 😢 해설을 보고 풀었거나, 못 풀었을 때 label Oct 21, 2025
@ShinHeeEul ShinHeeEul merged commit 53926d5 into main Oct 21, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fail 😢 해설을 보고 풀었거나, 못 풀었을 때

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants