Skip to content

Conversation

@0224LJH
Copy link
Contributor

@0224LJH 0224LJH commented Aug 5, 2025

🧷 문제 링크

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

🧭 풀이 시간

20분

👀 체감 난이도

✏️ 문제 설명

소수나라는 특이하게 모든 소수(prime number)를 화폐 단위로 사용한다.

물건을 구매하려던 하나는 소수나라의 화폐를 이용하여 N원을 정확히 만들 수 있는 방법의 가짓수가 얼마나 되는지 궁금해졌다.

하나를 도와 N원을 지불하기 위한 가짓수가 얼마나 되는지 구해보자.

단, 하나는 소수나라의 모든 화폐가 무한정 있다고 가정한다.

🔍 풀이 방법

에라스토테네스의 체 + dp를 하면 간단히 풀 수 있다. 이때 화폐를 무제한으로 쓸 수 있다고 하였기에 0 to target으로 순회를 하였다.

⏳ 회고

어제 왜 pr안갔지...

@0224LJH 0224LJH added the success 👍 해설을 보지 않고 풀었을 때 label Aug 5, 2025
@ShinHeeEul ShinHeeEul merged commit bf1c308 into main Aug 5, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

success 👍 해설을 보지 않고 풀었을 때

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants