[20250828] BOJ / G4 / 이모티콘 / 이준희 #759
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/14226
🧭 풀이 시간
40분
👀 체감 난이도
✏️ 문제 설명
이모티콘 입력 프로세스가
위 3가지가 있고 각각 1초가 걸릴 때
처음 1개의 이모티콘이 있는 상태에서 S개를 만들 수 있는 최소 시간을 구하는 문제입니다
🔍 풀이 방법
bfs를 이용하여 각 단계마다 3개 프로세스를 수행한 것을 다시 큐에 넣어서
다시 bfs를 하는 식으로 구현하였습니다.
S가 작기 때문에 처음에는 방문처리를 따로 하지 않는 방식으로 구현하였는데 메모리 초과가 났습니다.
그래서 방문배열을 사용해야 했는데, 각 단계마다 현재 화면의 이모티콘 개수와 클립보드에 저장되어있는 이모티콘 개수를 모두 관리해야하기 때문에 2차원 방문배열 [이모티콘 수, 클립보드] 를 사용하였습니다.
⏳ 회고
방문배열을 구성하는 방식이 특이해서 조금 걸렸던 것 같습니다