[20250220] BOJ / G4 / 같은 수로 만들기 / 권혁준 #158
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/2374
🧭 풀이 시간
32분
👀 체감 난이도
✏️ 문제 설명
Add연산을 한 번 하면, 어떤 원소에 대해, 좌우로 같은 값을 가지는 모든 원소에 1씩 더한다.(ex. {1,3,3,3,4} 에서 원소 3에
Add연산을 하면 {1,4,4,4,4}가 된다.)🔍 풀이 방법
[사용한 알고리즘]
Add연산으로 스택을 내림차순으로 만들어줄 수 있다.Add연산을 수행해서 5까지 최적의 방법으로 올릴 수 있다. 작업을 마치면 스택은 {6, 5}가 된다.⏳ 회고
https://www.acmicpc.net/problem/13146