Number of Divisors (Function)
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Given an integer ( n ), your task is to determine how many divisors it has, excluding 1 and ( n ) itself.
Implement the following function:
Pascal:
function CountDivisors(n: longint): longint;
C++:
int CountDivisors(int n);
Python:
def CountDivisors(n):
This function should return the number of divisors of ( n ).
Input
The function receives a single integer parameter n where ( 2 \leq n < 2^{31} ).
Output
The function should return a single integer representing the count of divisors of ( n ), excluding 1 and ( n ) itself.
Examples
Input #1
Answer #1
Submissions 3K
Acceptance rate 21%