[20251121] BOJ / G3 / 나머지 합 / 이준희 #1465
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/10986
🧭 풀이 시간
50분
👀 체감 난이도
✏️ 문제 설명
수열이 주어졌을 때
구간의 합이 M으로 나누어 떨어지는 경우의 갯수를 구하는 문제입니다.
🔍 풀이 방법
수열을 입력받으면서 나머지의 구간합을 구해서 수열을 구성하며 각 나머지 경우마다 몇번 등장하는지 수열로 유지하엿습니다.
이후 각 나머지의 갯수 k 개 중에서 2개를 뽑아서 서로 - 해서 나머지를 0으로 만드는 경우의 수를 계산했습니다.
⏳ 회고
생각보다 어려웠던 문제였습니다.
나머지끼리 빼서 0을 만드는 경우를 생각하는 것이 어려웠습니다.