Skip to content

Conversation

@Ukj0ng
Copy link
Contributor

@Ukj0ng Ukj0ng commented Jan 27, 2026

🧷 문제 링크

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

🧭 풀이 시간

40분

👀 체감 난이도

✏️ 문제 설명

f(x): x의 약수들의 합
g(x): 1~x들의 f(x)의 합
자연수 N이 주어졌을 때, g(N)을 구하라

🔍 풀이 방법

  1. 약수를 구하기
    약수들의 합을 직접 구하고 f(x)를 구하면 메모이제이션으로 풀었다. -> 시간 초과

  2. 배수로 구하기
    i면, i의 배수에 i를 더하는 방식으로 풀었다. N의 최댓값이 1000000이기 때문에 미리 다 구해놓고 누적합으로 구했다.

⏳ 회고

약수를 구하는 게 아니라 배수로 더하는 게 매우 참신한 풀이였다.

@ShinHeeEul ShinHeeEul merged commit 21c7df9 into main Jan 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants