Skip to content

Conversation

@oncsr
Copy link
Contributor

@oncsr oncsr commented Sep 23, 2025

🧷 문제 링크

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

🧭 풀이 시간

10분

👀 체감 난이도

✏️ 문제 설명

정수에 포함되어 있는 숫자 중 그 정수를 나눌 수 있는 2 이상의 숫자가 있다면, 그 숫자로 정수를 나눈다.
정수 k에 이 작업을 반복해서 1로 만들 수 있다면 이 정수를 valid하다고 한다.

N이 주어지면, 1부터 N까지의 정수 중 valid한 수의 개수를 구해보자.

🔍 풀이 방법

  • 백트래킹

1부터 10^9까지 valid한 수를 다 출력해봤는데, 개수가 2400개 밖에 없었다.
그래서 처음에 1에서 시작해서 백트래킹으로 valid한 수들만 set에 담도록 한 뒤 마지막에 set의 크기를 출력해줬다.

⏳ 회고

ez

@oncsr oncsr added the success 👍 해설을 보지 않고 풀었을 때 label Sep 23, 2025
@ShinHeeEul ShinHeeEul merged commit 6d8e841 into main Sep 23, 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