Skip to content

Conversation

@lkhyun
Copy link
Contributor

@lkhyun lkhyun commented Sep 21, 2025

🧷 문제 링크

https://www.acmicpc.net/problem/2015

🧭 풀이 시간

20분

👀 체감 난이도

✏️ 문제 설명

i부터 j까지의 합이 K가 되는 경우의 수 출력.

🔍 풀이 방법

누적합, 맵
입력받을때 누적합 구해놓기
i부터 j까지의 합이 K라는 건
A[j] - A[i-1] = K임.
배열의 앞에서부터 A[j]-K를 집합에서 찾고 있으면 카운트하는 방식.
즉, j가 i의 역할도 함께 하는 것.

⏳ 회고

누적합까지 바로 생각하고 투포인터를 써야하나 했는데 값들이 정수라서 고민했다.
정수일때, 누적합을 맵을 통해 구해낼 수 있다는 것을 알게 되었다.

@lkhyun lkhyun self-assigned this Sep 21, 2025
@lkhyun lkhyun added success 👍 해설을 보지 않고 풀었을 때 hint 💡 반례를 참고했거나 힌트를 얻고 풀었을 때 labels Sep 21, 2025
@ShinHeeEul ShinHeeEul merged commit da21aaf into main Sep 21, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hint 💡 반례를 참고했거나 힌트를 얻고 풀었을 때 success 👍 해설을 보지 않고 풀었을 때

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants