Count Distinct Prime Factors
Computer Mathematics
Medium
3 views
Problem Description
Given n, print how many distinct primes divide it.
Input Format
One integer n.
Output Format
One integer count.
Official Solution
Trial divide; when p divides, increment count and divide fully. If leftover>1 add 1.
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!