#C8694. Count Distinct Divisors
Count Distinct Divisors
Count Distinct Divisors
Given a positive integer (n), your task is to compute the number of distinct divisors of (n). A divisor (d) of (n) is an integer such that (d) divides (n) without leaving a remainder. For example, the divisors of (6) are (1), (2), (3), and (6), thus there are 4 divisors. This problem tests your ability to efficiently iterate through potential divisors and count them, using an algorithm optimized by checking up to (\sqrt{n}).
inputFormat
The input consists of a single integer (n) where (1 \le n \le 10^6), read from standard input.
outputFormat
Output a single integer to standard output representing the count of distinct divisors of (n).## sample
1
1