Skip to content

Conversation

@JHLEE325
Copy link
Contributor

@JHLEE325 JHLEE325 commented Nov 6, 2025

🧷 문제 링크

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

🧭 풀이 시간

40분

👀 체감 난이도

✏️ 문제 설명

N개의 원판을 하노이탑 했을 때 몇회 이동해야하는지 출력하고
N이 20이하라면 그 이동경로도 출력하는 문제입니다.

🔍 풀이 방법

하노이탑 재귀를 만들어서 풀었습니다.
N이 최대 100으로 매우 큰데 하노이탑 이동 횟수는 2^N -1 이기 때문에 long으로도 안됩니다. 그래서 BigInteger 사용했습니다.

⏳ 회고

처음에 long으로 풀었는데 틀릴 수가 없는데 틀렸다 해서 열받았는데 long 범위 문제였습니다.

@JHLEE325 JHLEE325 added the hint 💡 반례를 참고했거나 힌트를 얻고 풀었을 때 label Nov 6, 2025
@ShinHeeEul ShinHeeEul merged commit 77157e7 into main Nov 6, 2025
1 check passed
@oncsr
Copy link
Contributor

oncsr commented Nov 6, 2025

골드 6은 어느 나라 티어인가요 ..?

@JHLEE325
Copy link
Contributor Author

JHLEE325 commented Nov 6, 2025

미안합니다

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hint 💡 반례를 참고했거나 힌트를 얻고 풀었을 때

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants