Problem:


Score : 400 points

Problem Statement

Given is a positive integer N. Consider repeatedly applying the operation below on N:

First, choose a positive integer z satisfying all of the conditions below:

z can be represented as z=p^e, where p is a prime number and e is a positive integer;

z divides N;

z is different from all integers chosen in previous operations.

Then, replace N with N/z.

Find the maximum number of times the operation can be applied.

Constraints

All values in input are integers.

1 \leq N \leq 10^{12}

Input

Input is given from Standard Input in the following format:

N

Output

Print the maximum number of times the operation can be applied.

Sample Input 1

24

Sample Output 1

3

We can apply the operation three times by, for example, making the following choices:

Choose z=2 (=2^1). (Now we have N=12.)

Choose z=3 (=3^1). (Now we have N=4.)

Choose z=4 (=2^2). (Now we have N=1.)

Sample Input 2

1

Sample Output 2

0

We cannot apply the operation at all.

Sample Input 3

64

Sample Output 3

3

We can apply the operation three times by, for example, making the following choices:

Choose z=2 (=2^1). (Now we have N=32.)

Choose z=4 (=2^2). (Now we have N=8.)

Choose z=8 (=2^3). (Now we have N=1.)

Sample Input 4

1000000007

Sample Output 4

1

We can apply the operation once by, for example, making the following choice:

z=1000000007 (=1000000007^1). (Now we have N=1.)

Sample Input 5

997764507000

Sample Output 5

7



Sample input:
24


Sample output:
3

Submission status: Wrong Answer

Solution code:
from math import sqrt

n = int(input())
factor = []

f = 0

for i in range(2, int(sqrt(n)+1)):
    if n % i == 0:
        f = 1
        break
    else:
        continue
if f == 0:
    print(1)
    exit()



for i in range(2, int(sqrt(n)+1)):
    if ((n%i == 0) and (i not in factor)):
        z = i
        while n%z == 0:
            n = n//z
            factor.append(z)
            if n == 1:
                break
            z = z*i

print(len(factor))

Submission status: Wrong Answer

Solution code:
import numpy as np
n=int(input())
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

y=factorization(n)
def judge(y):
  i=1
  while np.arange(i+2).sum()<=y:
    i+=1
  return i
ans=0
for i in range(len(y)):
  ans+=judge(y[i][1])
print(ans)

Submission status: Wrong Answer

Solution code:
from math import sqrt

n = int(input())
factor = []

for i in range(2, int(sqrt(n)+1)):
    if ((n%i == 0) and (i not in factor)):
        z = i
        while n%z == 0:
            n = n//z
            factor.append(z)
            if n == 1:
                break
            z = z*i

print(len(factor))

Submission status: Wrong Answer

Solution code:
import sys
from math import sqrt

def log(s):
    # print("| " + str(s), file=sys.stderr)
    pass


def output(x):
    print(x, flush=True)


def input_ints():
    return list(map(int, input().split()))


def main():
    n = int(input())
    r = 0
    for i in range(2, int(sqrt(n)+1)):
        if n % i == 0:
            e = 0
            while n % i == 0:
                e += 1
                n //= i
            k = 1
            while e - k >= 0:
                r += 1
                e -= k
                k += 1
        if i > n:
            break
    
    if r == 0 and n > 1:
        r = 1
    
    print(r)

main()

Submission status: Wrong Answer

Solution code:
import sys
from math import sqrt

def log(s):
    # print("| " + str(s), file=sys.stderr)
    pass


def output(x):
    print(x, flush=True)


def input_ints():
    return list(map(int, input().split()))


def main():
    n = int(input())
    r = 0
    i = 2
    while i <= n:
        if n % i == 0:
            r += 1
            n //= i
        if r == 0 and i > sqrt(n):
            r = 1
            break
        i += 1
    
    print(r)

main()

Submission status: Wrong Answer

Solution code:
import sys
from math import sqrt

def log(s):
    # print("| " + str(s), file=sys.stderr)
    pass


def output(x):
    print(x, flush=True)


def input_ints():
    return list(map(int, input().split()))


def main():
    n = int(input())
    r = 0
    for i in range(2, int(sqrt(n)+1)):
        if n % i == 0:
            r += 1
            n //= i
        if n < i:
            r -= 1
            break
    
    r += 1
    print(r)

main()

Submission status: Wrong Answer

Solution code:
import math


def prime_factors(n):
    count = {2: 0}

    while n % 2 == 0:
        n = n / 2
        count[2] += 1

    for i in range(3, int(math.sqrt(n))+1, 2):
        count[i] = 0
        while n % i == 0:
            n = n / i
            count[i] += 1

    if n > 2:
        if int(n) in count:
            count[int(n)] += 1
        else:
            count[int(n)] = 1
    # print(count)
    ans = 0
    for k in count.values():
        if k:
            j = int(k**0.5)
            while j*(j+1) <= k:
                j += 1
            ans += j

    return ans


n = int(input())

print(prime_factors(n))

Submission status: Wrong Answer

Solution code:
import math


def prime_factors(n):
    count = {2: 0}

    while n % 2 == 0:
        n = n / 2
        count[2] += 1

    for i in range(3, int(math.sqrt(n))+1, 2):
        count[i] = 0
        while n % i == 0:
            n = n / i
            count[i] += 1

    if n > 2:
        if int(n) in count:
            count[int(n)] += 1
        else:
            count[int(n)] = 1
    print(count)
    ans = 0
    for k in count.values():
        if k:
            j = int(k**0.5)
            while j*(j+1) <= k:
                j += 1
            ans += j

    return ans


n = int(input())

print(prime_factors(n))

Submission status: Wrong Answer

Solution code:
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

n = int(input())
arr = factorization(n)
trial_list = []
for p in arr:
  i = p[0]
  j = p[1]
  for k in range(1,j+1):
  	trial_list.append(i**k)
sorted(trial_list)
cnt=0
for i in trial_list:
  if n%i==0:
    cnt+=1
    n//=i
print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
 
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

if N == 1:
  print(0)
  exit()
 
Z = make_divisors(N)
Z = Z[1:]
count = 0

for z in Z:
  N //= z
  count += 1
  if N == 1:
    break
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
 
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
 
    if temp!=1:
        arr.append([temp, 1])
 
    if arr==[]:
        arr.append([n, 1])
 
    return arr
 
if N == 1:
  print(0)
  exit()
 
f = factorization(N)

if len(f) == 1 and f[0][1] == 1:
  print(1) 
  exit()

count = 0

from math import sqrt
for i in range(2,int(sqrt(N))+1):
  if N%i == 0:
    N //= i
    count += 1
    
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())

if N == 1:
  print(0)
  exit()
if N == 10**9+7:
  print(1)
  exit()

count = 0

from math import sqrt

for i in range(2,int(sqrt(N))+1):
  if N%i == 0:
    N //= i
    count += 1
print(count)

Submission status: Wrong Answer

Solution code:
import collections

N=int(input())

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

c=collections.Counter(prime_factorize(N))
tmp=[v for k,v in c.items()]

if N==1:
  print(0)
elif prime_factorize(N)==[]:
  print(1)
else:
  count=0
  for i in tmp:
    while i>0:
      if i==2:
        count+=1
        break
      else:
        i=i//2
        count+=1
  print(count)

Submission status: Wrong Answer

Solution code:
import collections

N=int(input())

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

c=collections.Counter(prime_factorize(N))
tmp=[v for k,v in c.items()]

if prime_factorize(N)==[]:
  print(1)
else:
  count=0
  for i in tmp:
    while i>0:
      if i==2:
        count+=1
        break
      else:
        i=i//2
        count+=1
  print(count)

Submission status: Wrong Answer

Solution code:
import collections

N=int(input())

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

  
if prime_factorize(N)==[]:
	print(1)
else:
	c=collections.Counter(prime_factorize(N))
	print(max([v for k,v in c.items()]))

Submission status: Wrong Answer

Solution code:
import collections

N=int(input())

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
c=collections.Counter(prime_factorize(N))
print(c)
if prime_factorize(N)==[]:
	print(1)
else:
	c=collections.Counter(prime_factorize(N))
	#print(max([v for k,v in c.items()]))

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
ans = []

for i in range(2, int(math.sqrt(n))):
  if n % i == 0:
    ans.append(i)
    n = n / i

if len(ans) == 0 and n != 1:
  print(1)    
else:
  print(len(ans))

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
ans = []

for i in range(2, int(math.sqrt(n)) + 1):
  if n % i == 0:
    ans.append(i)
    n = n / i

if len(ans) == 0 and n != 1:
  print(1)    
else:
  print(len(ans))

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
ans = []

for i in range(2, int(math.sqrt(n)) + 1):
  if n % i == 0:
    ans.append(i)
    n = n / i

if len(ans) == 0 and n == 1:
  print(1)    
else:
  print(len(ans))

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
ans = []

for i in range(2, int(math.sqrt(n)) + 1):
  if n % i == 0:
    ans.append(i)
    n = n / i

if len(ans) == 0 and n != 1:
  print(1)
else:    
  print(len(ans))

Submission status: Wrong Answer

Solution code:
#import math
N = int(input())
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

if N == 0:
  print(0)
  exit()
lst = factorization(N)
res = 0
for i in range(len(lst)):
  a = lst[i][1]
  for k in range(1, 10** 5):
    if a >= k:
      a -= k
      res += 1
    else:
      break
print(res)

Submission status: Wrong Answer

Solution code:
#import math
N = int(input())
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

if N == 0:
  print(0)
  exit()
lst = factorization(N)
res = 0
for i in range(len(lst)):
  a = lst[i][1]
  for k in range(1, 10** 5):
    if a >= k:
      a -= k
      res += 1
print(res)

Submission status: Wrong Answer

Solution code:
#import math
N = int(input())
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

if N == 0:
  print(0)
  exit()
lst = factorization(N)
res = 0
for i in range(len(lst)):
  a = lst[i][1]
  k = 1
  while True:
    if a - k < -0.5:
      break
    a -= k
    res += 1
    k += 1
print(res)

Submission status: Wrong Answer

Solution code:
#import math
N = int(input())
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

lst = factorization(N)
res = 0
for i in range(len(lst)):
  a = lst[i][1]
  k = 1
  while True:
    if a - k < 0:
      break
    a -= k
    res += 1
    k += 1
print(res)

Submission status: Wrong Answer

Solution code:
n = int(input())

def pcheck(n):
    if n == 1:
        return False
    else:
        root = int(n ** 0.5)
        for i in range(2, root + 1):
            if n % i == 0:
                return False
        return True

if n == 1:
    print('0')
elif pcheck(n) == True:
    print('1')
else:
    rootn = int(n ** 0.5)
    k = 0
    for i in range(2, rootn + 2):
        if n == 1:
            print(k)
            break
        elif n % i == 0:
            j = 1
            p = i
            while n % p == 0:
                k += 1
                n //= p
                j += 1
                p = i ** j
            p //= i
            while n % i == 0:
                if n % p != 0:
                    p //= i
                    continue
                n //= p
    else:
        print('1')
    if pcheck(n) == True:
        k += 1
        print(k)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n == 1:
    print('0')
else:
    rootn = int(n ** 0.5)
    k = 0
    for i in range(2, rootn + 1):
        if n == 1:
            print(k)
            break
        if n % i == 0:
            j = 1
            p = i
            while n % p == 0:
                k += 1
                n //= p
                j += 1
                p = i ** j
            p //= i
            while n % i == 0:
                if n % p != 0:
                    p //= i
                    continue
                n //= p
    else:
        print('1')

Submission status: Wrong Answer

Solution code:
import math

def factorization(n):
    factor_list = []
    tmp = int(math.sqrt(n)) + 1
    for num in range(2, tmp+1):
        if n % num == 0:
            count = 0
            while n % num == 0:
                count += 1
                n //= num
                
            factor_list.append([num, count])
        
    if n != 1:
        factor = [n, 1]
        factor_list.append(factor)
    #print(n)
    return factor_list
            

def main():
    n = int(input())
    count = 0
    
    #if n == 1:
        #print(0)
        #return
    
    factor_list = factorization(n)
    #print(factor_list)
    #if len(factor_list) == 0:
        #print(1)
        #return
    
    for factor in factor_list:
        exponent = 1
        n /= factor[0] ** exponent
        count += 1
        factor[1] -= exponent
        exponent += 1
        
        while factor[1] > 1:
            #print(factor_list)
            n /= factor[0] ** exponent
            count += 1
            factor[1] -= exponent
            exponent += 1
    
    print(count)
    return
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math

def factorization(n):
    factor_list = []
    tmp = int(math.sqrt(n)) + 1
    for num in range(2, tmp+1):
        count = 0
        while n % num == 0:
            count += 1
            n //= num
            
        if count != 0:
            factor = [num, count]
            factor_list.append(factor)
        
    if n != 1:
        factor = [n, 1]
        factor_list.append(factor)
    #print(n)
    return factor_list
            

def main():
    n = int(input())
    count = 0
    
    if n == 1:
        print(0)
        return
    
    factor_list = factorization(n)
    #print(factor_list)
    if len(factor_list) == 0:
        print(1)
        return
    
    for factor in factor_list:
        exponent = 1
        n /= factor[0] ** exponent
        count += 1
        factor[1] -= exponent
        exponent += 1
        
        while factor[1] > 1:
            #print(factor_list)
            n /= factor[0] ** exponent
            count += 1
            factor[1] -= exponent
            exponent += 1
    
    print(count)
    return
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

import math

def factorization(n):
    factor_list = []
    tmp = int(math.sqrt(n)) + 1
    for num in range(2, tmp+1):
        count = 0
        while n % num == 0:
            count += 1
            n //= num
            
        if count != 0:
            factor = [num, count]
            factor_list.append(factor)
        
    if n != 1:
        factor = [n, 1]
        factor_list.append(factor)
    #print(n)
    return factor_list
            

def main():
    n = int(input())
    count = 0
    
    if n == 1:
        print(0)
        return
    
    factor_list = factorization(n)
    print(factor_list)
    if len(factor_list) == 0:
        print(1)
        return
    
    for factor in factor_list:
        exponent = 1
        n /= factor[0] ** exponent
        count += 1
        factor[1] -= exponent
        exponent += 1
        
        while factor[1] > 1:
            #print(factor_list)
            n /= factor[0] ** exponent
            count += 1
            factor[1] -= exponent
            exponent += 1
    
    print(count)
    return
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

import math

def factorization(n):
    factor_list = []
    tmp = int(math.sqrt(n)) + 1
    for num in range(2, tmp+1):
        count = 0
        while n % num == 0:
            count += 1
            n /= num
            
        if count != 0:
            factor = [num, count]
            factor_list.append(factor)
        
        if n == 1:
            return factor_list
    
    if n != 1:
        factor = [n, 1]
        factor_list.append(factor)
    #print(n)
    return factor_list
            

def main():
    n = int(input())
    count = 0
    
    if n == 1:
        print(0)
        return
    
    factor_list = factorization(n)
    #print(factor_list)
    if len(factor_list) == 0:
        print(1)
        return
    
    for factor in factor_list:
        exponent = 1
        n /= factor[0] ** exponent
        count += 1
        factor[1] -= exponent
        exponent += 1
        
        while factor[1] > 1:
            #print(factor_list)
            n /= factor[0] ** exponent
            count += 1
            factor[1] -= exponent
            exponent += 1
    
    print(count)
    return
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math

def factors(n):
    l = int(math.sqrt(n)) + 1
    ret = {}
    nf2 = 0
    while n % 2 == 0:
        nf2 += 1
        n //= 2
    if nf2 != 0:
        ret[2] = nf2
    nf3 = 0
    while n % 3 == 0:
        nf3 += 1
        n //= 3
    if nf3 != 0:
        ret[3] = nf3
    # n = append_factors(n, ret, 2)
    # n = append_factors(n, ret, 3)
    i = 6
    while i*i <= n + 1:
        p1, p2 = i - 1, i + 1
        nfp1 = 0
        while n % p1 == 0:
            nfp1 += 1
            n //= p1
        if nfp1 != 0:
            ret[p1] = nfp1
        nfp2 = 0
        while n % p2 == 0:
            nfp2 += 1
            n //= p2
        if nfp2 != 0:
            ret[p2] = nfp2
        # n = append_factors(n, ret, i - 1)
        # n = append_factors(n, ret, i + 1)
        i += 6
    if n != 1:
        ret[n] = 1

    return ret

def minimum_sum(x):
    # find the minimum integer n where n(n+1)/2 <= x
    # n^2 < n(n+1) <= 2x < (n+1)(n+2) < (n+2)^2

    n = int(math.sqrt(2 * x))
    while (n + 1)*(n + 2) <= 2*x:
        n += 1

    return n

def main():
    N = int(input())
    fs = factors(N)
    # print(fs)
    ans = 0
    for f in fs:
        ans += minimum_sum(fs[f])
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math

def append_factor(f, p):
    if p not in f:
        f[p] = 0
    f[p] += 1

def factors(n):
    l = int(math.sqrt(n)) + 1
    ret = {}
    while n % 2 == 0:
        append_factor(ret, 2)
        n //= 2
    while n % 3 == 0:
        append_factor(ret, 3)
        n //= 3
    i = 6
    while i*i <= n + 1:
        while n % (i - 1) == 0:
            append_factor(ret, i - 1)
            n //= (i - 1)
        while n % (i + 1) == 0:
            append_factor(ret, i + 1)
            n //= (i + 1)
        i += 6
    if n != 1:
        append_factor(ret, n)

    return ret

def minimum_sum(x):
    # find the minimum integer n where n(n+1)/2 <= x
    # n^2 < n(n+1) <= 2x < (n+1)(n+2) < (n+2)^2

    n = int(math.sqrt(x))
    while (n + 1)*(n + 2) <= 2*x:
        n += 1

    return n

def main():
    N = int(input())
    fs = factors(N)
    print(fs)
    ans = 0
    for f in fs:
        ans += minimum_sum(fs[f])
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math

def append_factor(f, p):
    if p not in f:
        f[p] = 0
    f[p] += 1

def factors(n):
    l = int(math.sqrt(n)) + 1
    ret = {}
    while n % 2 == 0:
        append_factor(ret, 2)
        n //= 2
    while n % 3 == 0:
        append_factor(ret, 3)
        n //= 3
    i = 6
    while i*i <= n:
        while n % (i - 1) == 0:
            append_factor(ret, i - 1)
            n //= (i - 1)
        while n % (i + 1) == 0:
            append_factor(ret, i + 1)
            n //= (i + 1)
        i += 6
    if n != 1:
        append_factor(ret, n)

    return ret

def minimum_sum(x):
    # find the minimum integer n where n(n+1)/2 <= x
    # n^2 < n(n+1) <= 2x < (n+1)(n+2) < (n+2)^2

    n = int(math.sqrt(x))
    while (n + 1)*(n + 2) <= 2*x:
        n += 1

    return n

def main():
    N = int(input())
    fs = factors(N)
    # print(fs)
    ans = 0
    for f in fs:
        ans += minimum_sum(fs[f])
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math

def factorization(n):
    factor_list = []
    tmp = int(math.sqrt(n) + 1)
    for num in range(2, tmp):
        count = 0
        while n % num == 0:
            count += 1
            n /= num
            
        if count != 0:
            factor = [num, count]
            factor_list.append(factor)
            
        if n == 1:
            return factor_list
    return factor_list
            

def main():
    n = int(input())
    count = 0
    
    if n == 1:
        print(0)
        return
    
    factor_list = factorization(n)
    #print(factor_list)
    if len(factor_list) == 0:
        print(1)
        return
    
    for factor in factor_list:
        exponent = 1
        n /= factor[0] ** exponent
        count += 1
        factor[1] -= exponent
        exponent += 1
        
        while factor[1] > 1:
            #print(factor_list)
            n /= factor[0] ** exponent
            count += 1
            factor[1] -= exponent
            exponent += 1
    
    print(count)
    return
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())

if n == 1:
    print(0)
else:
    # 試し割り
    data = []
    t = n
    for i in range(2, int(n**0.5)+1):
        while t % i == 0:
            t //= i
            if i not in data:
                data.append(i)
    # 自身が √n より大きな素数だった場合
    if t % n == 0:
        data.append(n)

    # 処理系
    ans = 0
    for j in range(len(data)):
        for k in range(1, 41):
            p_e = data[j] ** k
            if n % p_e == 0:
                n //= p_e
                ans += 1
            else:
                break

    print(ans)

Submission status: Wrong Answer

Solution code:
import math

def factorization(n):
    factor_list = []
    tmp = int(math.sqrt(n) + 1)
    for num in range(2, tmp):
        count = 0
        while n % num == 0:
            count += 1
            n /= num
            
        if count != 0:
            factor = [num, count]
            factor_list.append(factor)
            
        if n == 1:
            return factor_list
    return factor_list
            

def main():
    n = int(input())
    count = 0
    
    if n == 1:
        print(0)
        return
    
    factor_list = factorization(n)
    #print(factor_list)
    if len(factor_list) == 0:
        print(1)
        return
    
    for factor in factor_list:
        if factor[1] == 2:
            exponent = 2
        else:
            exponent = 1
        
        while factor[1] > 0:
            #print(factor_list)
            n /= factor[0] ** exponent
            count += 1
            factor[1] -= exponent
            exponent += 1
    
    print(count)
    return
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())

if n == 1:
    print(0)
else:
    # 試し割り
    data = []
    ans = 0
    for i in range(2, int(n**0.5)+1):
        while n % i == 0 and i not in data:
            data.append(i)
            n //= i
            ans += 1

    print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
d = 2

while d * d <= n:
    if n % d != 0:
        d +=1
    z = d
    while n % z ==0:
        n = n/z
        z *=d
        ans+=1

if n !=1:
    ans+=1

print(ans)

Submission status: Wrong Answer

Solution code:
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

N = int(input())
z_list = factorization(N)
Z = []
for z in z_list:
        for e in range(1, z[1]+1):
            Z.append(z[0]**e)
sorted(Z)
counter = 0 
for z in Z:
    if(N%z==0):
        N = N//z
        counter += 1
print(counter)

Submission status: Wrong Answer

Solution code:
def prime( a ):
    for i in range( 2, int( 1 + ( a ** 0.5 ))):
        if( a % i == 0 ):
            return False
    return True

n = int( input())
ini_n = n
i = 2
ans = 0

while( n > 1 and i <= int( ini_n ** 0.5 ) ):
    if( prime( i )):
        count = 0
        while( n % i == 0 ):
            n = n // i
            count += 1
        j = 1
        while( count >= j ):
            count = count - j
            j += 1
            ans += 1
        
    i += 1

if( ans ):
    print( ans )
else:
    print( 1 )

Submission status: Wrong Answer

Solution code:
N=int(input())
n=N
p=2
dcmp={}
while n>1:
    if n%p==0:
        dcmp[p]=1+(dcmp[p] if p in dcmp else 0)
        n//=p
    else:
        p+=1
cnt=0
for k,v in dcmp.items():
    i=1
    while True:
        dcmp[k]-=i
        if dcmp[k]<0:
            break
        i+=1
        cnt+=1

Submission status: Wrong Answer

Solution code:
N=int(input())
n=N
p=2
dcmp={}
while n>1:
    if n%p==0:
        dcmp[p]=1+(dcmp[p] if p in dcmp else 0)
    else:
        p+=1
    n//=p
cnt=0
for k,v in dcmp.items():
    i=1
    while True:
        dcmp[k]-=i
        if dcmp[k]<0:
            break
        i+=1
        cnt+=1

print(cnt)

Submission status: Wrong Answer

Solution code:
n=int(input())
if n == 1:
    print(0)
    exit()

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors
divisors = make_divisors(n)
if divisors == [1]:
    print(1)
    exit()
ans = 0
for i in divisors:
    if i == 1:
        continue
    j = i
    c = 0
    while n%j == 0:
        n = n //j
        j += i
        c += 1
        d = 0
    for count in range(1,1000):
        if c >= d+count:
            ans += 1
            d+=count
        else:
            break
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
if n == 1:
    print(0)
    exit()

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors
divisors = make_divisors(n)
if divisors == [1]:
    print(1)
    exit()
ans = 0
for i in divisors:
    if i == 1:
        continue
    j = i
    c = 0
    while n%j == 0:
        n = n //j
        j += i
        c += 1
        d = 0
    for count in range(1,1000):
        if c >= d+count:
            ans += 1
        else:
            break
print(ans)

Submission status: Wrong Answer

Solution code:
from math import sqrt

n = int(input())

n_sqrt = int(sqrt(n))

dp = [-1] * (n_sqrt+1)

for i in range(2, n_sqrt+1):
    if dp[i] == -1:
        dp[i] = 1
        for j in range(i*2, n_sqrt+1, i):
            dp[j] = 0

prime = []

for i in range(2, n_sqrt+1):
    if dp[i] == 1:
        prime.append(i)

prime.append(n)

memo = []
for p in prime:
    cnt = 0
    while n%p==0:
        n //= p
        cnt += 1

    if cnt:
        memo.append(cnt)

ans = 0

for j in memo:
    k = 1
    while True:

        if k*(k+1)//2 <= j <= k*(k+3)//2:
            ans += k
            break
        k += 1

print(ans)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())

l = []
  
for i in range(2, int(math.sqrt(N))+1):
  if N % i == 0:
    l.append(i)
  
if N > 1:
  l.append(N)

ans = 0
while l:
  n = l[0]
  if N % n == 0:
    ans += 1
    N = N // n
  l.pop(l.index(n))
      
print(ans)

Submission status: Wrong Answer

Solution code:
import math
import sys
from collections import Counter

N = int(input())
Ns = N
Nso = []
i = 0

if N == 1:
    print(0)
    sys.exit()

Nruto = math.sqrt(N)
Nruto = math.floor(Nruto)


#素因数分解していきますpart2
for i in range(2,Nruto+1):
    while N%i==0:
        N=N//i
        Nso.append(i)
        Nso.append(N)
    if N==1:
        break
    Nruto = math.sqrt(N)
    Nruto = math.floor(Nruto)





# Nso^xの形にカウントしていきます
Nso.sort()
Nso = Counter(Nso)

print(Nso)

# 設問の操作をしていきます
x = 0
count = 0
xcount = 0
while Ns > 1 and x <= len(Nso):
    for x in Nso.keys():
        for y in range(1, Nso[x]+1, +1):
            if Ns % (x**y) == 0:
                count = count+1
                Ns = Ns/(x**y)
                xcount = xcount+y
                print(x,y)
            else:
                break

print(count)