fork(12) download
  1. used=[0 for i in range (10**6)]
  2. primes = []
  3.  
  4. for i in range (2, 10**6):
  5. primes. append (i)
  6. if not used [i] :
  7. for j in range (2*i,10**6,i):
  8. used[j] =1
  9.  
  10.  
  11. ans=1
  12. N=int (input ())
  13.  
  14. for p in primes:
  15. if p**3>N:
  16. break
  17. cnt=1
  18. while not N%p:
  19. N/=p
  20. cnt+=1
  21. ans*=cnt
  22.  
  23. n_prime=True
  24.  
  25. from math import sqrt
  26. for i in range (2, int(sqrt (N))):
  27. if not N%i:
  28. n_prime=False
  29. break
  30.  
  31. if n_prime:
  32. ans*=2
  33. elif int(sqrt(N))**2==N:
  34. ans*=3
  35. elif N!=1:
  36. ans*=4
  37.  
  38. print (ans)
Success #stdin #stdout 0.4s 27720KB
stdin
50761746622
stdout
8