[20251203] BOJ / G5 / 1학년 / 강신지 #1575
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/5557
🧭 풀이 시간
50분
👀 체감 난이도
✏️ 문제 설명
숫자들이 주어지고 마지막 숫자는 무조건 결과 숫자임.
결과 숫자 제외하고 앞의 숫자들을 각각 더하거나 빼서 결과 숫자와 같게 만드는 방법의 수 구하기.
🔍 풀이 방법
첫번째 수부터 차례대로 계산할 때 중간에 나오는 값은 무조건 0에서 20 사이라는 조건이 있어서 그걸 가지고 dp로 풀었음.
⏳ 회고
완탐하면 안되는데 dp 쓰면 되겠다는 생각을 하는 데에 오래 걸림