NDIV - n-divisors
We all know about prime numbers, prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself.
We can Classify the numbers by its number of divisors, as n-divisors-numbers, for example number 1 is 1-divisor number, number 4 is 3-divisors-number... etc.
Note: All prime numbers are 2-divisors numbers.
8 is a 4-divisors-number [1, 2, 4, 8].
Three integers a, b, n.
Print single line the number of n-divisors numbers between a and b inclusive.
Input: 1 7 2 Output: 4
1 <= a, b <=10^9
0 <= b - a <= 10^4
1 <= n <= 100
4 RE due to including unnecessary test case!!
0.00 s with segmented sieve for divisors
use fast i/o for this problem..also sieving must be done till sqrt(10^9).
AC in 1 go, nice question, 0.00 sec :D
strict time limit but AC...
this is an easy one if you understand the concept of prime factorization and sieve :)
I m getting TLE, I think my solution is efficient. PLEASE HELP
made a lot of mistakes trying a lot of different algorithms, finally got AC
Easy one. AC in one go :D.
ideone time limit:0.01s