TopCoder problem "
NumberOfDivisors
" used in SRM 370 (Division I Level Three)
Problem Statement
Return the smallest positive integer that has exactly
k
divisors. If this number is greater than 10
18
, return -1 instead.
Definition
Class:
NumberOfDivisors
Method:
smallestNumber
Parameters:
int
Returns:
long
Method signature:
long smallestNumber(int k)
(be sure your method is public)
Constraints
-
k
will be between 1 and 50000, inclusive.
Examples
0)
1
Returns: 1
1)
2
Returns: 2
2)
6
Returns: 12
The 6 divisors of 12 are: 1, 2, 3, 4, 6, 12.
Problem url:
http://www.topcoder.com/stat?c=problem_statement&pm=7863
Problem stats url:
http://www.topcoder.com/tc?module=ProblemDetail&rd=10786&pm=7863
Writer:
mateuszek
Testers:
PabloGilberto , Olexiy , lovro , ivan_metelsky
Problem categories:
Dynamic Programming, Math