[20250823] BOJ / G4 / 단어 수학 / 이준희 #723
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/1339
🧭 풀이 시간
30분
👀 체감 난이도
✏️ 문제 설명
ABA
BCD
처럼 수가 단어로 주어졌을 때
단어 수를 더했을 때 나올 수 있는 값의 최대값을 구하는 문제입니다.
🔍 풀이 방법
문자를 받은 후 알파벳 배열에 자릿수를 계산한 후
ex) ABA, BCD 기준 A : 101 / B 110 / C 10 / D 1 처럼 계산
그 자릿수를 우선순위큐 reverse 를 사용하여 큰 것부터 꺼내면서
9,8,7... 을 곱해서 더했습니다.
⏳ 회고
우선순위 큐 reverse를 사용하는 문제를 최근에 봤던 것 같은데 그 기억으로 쉽게 풀 수 있었습니다.