[20250809] BOJ / G1 / 2048 (Easy) / 이준희 #638
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🧷 문제 링크
https://www.acmicpc.net/problem/12100
🧭 풀이 시간
60분
👀 체감 난이도
✏️ 문제 설명
2048 게임 시뮬레이션을 구현해서 5번 움직여서 나올수 있는 최대값을 구하는 문제입니다.
🔍 풀이 방법
각 방향(상,하,좌,우) 마다 이동시켜서 계산하는 로직을 구현하였습니다.
각 열 또는 행 마다 0이 아닌 숫자를 큐에 넣어서 연속으로 나올 경우 두 수를 더해서 배열에 저장하고
그 배열을 결과값으로 받아서 dfs를 하는 식으로 구현했습니다.
⏳ 회고
예전부터 풀만한거 같아서 열었다가 만만하지 않아서 못풀었던 문제인데 풀어서 개운합니다
난이도에 비해서는 조금 쉬운감이 있지 않나 싶습니다.