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:
n=int(input())

def primes_factraizar(n):
    rn = int(n**0.5)
    is_prime = [True] * (rn+1) #まずは[1]*n^0.5を用意
    is_prime[0] = False 
    is_prime[1] = False
    for i in range(2, rn + 1): #素数の判定√nまでで十分
        if not is_prime[i]: #非素数は無視
            continue            #continue分はループ中の後続の命令をスキップする
        for j in range(i * 2, rn + 1, i): #i*2~nまでのiの倍数を順番に消す
            is_prime[j] = False
    return [i for i in range(rn + 1) if is_prime[i]]
primes = primes_factraizar(n)





div = []
for i in primes:
    N=n
    for j in range(100):
        if N%i==0:
            N=N//i
        else:
            if j == 0:
                break
            div.append(j)
            break

if div == []:
    print(1)
    exit()
ans = 0
for i in div:
    c = 0
    for j in range(1,100):
        if i >= c+j:
            c+=j
        else:
            ans += j-1
            break
print(ans)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
div = 2
res = 0
m = int(math.sqrt(n))
while div < m:
    cnt = 0
    if ((n // div) * div != n):
        div += 1
        continue
    while (n // div) * div == n:
        cnt += 1
        n = n // div
    #print(div, cnt)
    tmp = 1
    while tmp < cnt:
        res += 1
        cnt -= tmp
        tmp += 1
    if (n == 1):
        div = m
    div += 1
print(res+1*(n != 1))

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
div = 2
res = 0
m = int(math.sqrt(n))
while div < m:
    cnt = 0
    if ((n // div) * div != n):
        div += 1
        continue
    while (n // div) * div == n:
        cnt += 1
        n = n // div
    #print(div, cnt)
    if cnt > 0:
        a = int(math.sqrt(cnt*2))
        a = a - (cnt > a * (a + 1) // 2) * 1
        if cnt == 2:
            a = 1
        res += a
    if (n == 1):
        div = m
    div += 1
print(res+1*(n != 1))

Submission status: Wrong Answer

Solution code:
n =int(input())

wk =0
i =2
j =3
while n >=i:
    if n%i==0:
        wk+=1
        n/=i
        i*=2
    else:
        break
while n >=j:
    if n%j==0:
        wk+=1
        n/=j
        j*=3
    else:
        break

while n>=j:
    j+=2
    k=j
    while n>=k:
        if n%k==0:
            wk+=1
            n//=k
            k*=k
        else:
            break
if n != 1:
    wk+=1
print(wk)

Submission status: Wrong Answer

Solution code:
import collections
n=int(input())
if n==1:
  print(0)
  exit()
b=int(n**0.5)
i=2
l=[]
while i<=b+1:
  if n==1:
    break
  if n%i==0:
    l.append(i)
    n=n//i
  else:
    i+=1
l.append(n)
c=collections.Counter(l)
v=list(c.values())

ans=0
for vv in v:
  wa=1
  s=1
  while True:
    if vv<wa:
      break
    s+=1
    wa+=s
  ans+=(s-1)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

def prime_factorise(n):
    a = []
    tmp = n
    for i in range(2, int(n**0.5//1 + 1)):
        if tmp % i == 0:
            index = 0  # 指数
            while tmp % i == 0:
                index += 1
                tmp //= i
            a.append([i, index])

    if tmp != 1:
        a.append([tmp, 1])

    print(a)
    return a

x = prime_factorise(n)
count = 0


for i in range(len(x)):
    if x[0][0] == 1:
        break

    k = x[i][1]  # 指数の値
    for j in range(k):
        if n % (x[i][0] ** (j+1)) == 0:
            n //= x[i][0] ** (j+1)
            count += 1
            k -= (j+1) #指数の値をへらす

        elif n % (x[i][0]**(j+1)) != 0:
            break
        
        if k <= 0:
            break

print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())

def prime_factorise(n):
    a = []
    tmp = n
    for i in range(2, int(n**0.5//1 + 1)):
        if tmp % i == 0:
            index = 0  # 指数
            while tmp % i == 0:
                index += 1
                tmp //= i
            a.append([i, index])

    if tmp != 1:
        a.append([tmp, 1])

    print(a)
    return a

x = prime_factorise(n)
count = 0


for i in range(len(x)):
    if x[0][0] == 1:
        break

    k = x[i][1]  # 指数の値
    for j in range(k):
        if n % (x[i][0] ** (j+1)) == 0:
            n //= x[i][0] ** (j+1)
            count += 1
            k -= (j+1) #指数の値をへらす

        elif n % (x[i][0]**(j+1)) != 0:
            break

print(count)

Submission status: Wrong Answer

Solution code:
import collections
n=int(input())
if n==1:
  print(0)
  exit()
b=int(n**0.5)
i=2
l=[]
while i<=b+1:
  if n==1:
    break
  if n%i==0:
    l.append(i)
    n=n//i
  else:
    i+=1
if len(l)==0:
  print(1)
  exit()
c=collections.Counter(l)
v=list(c.values())
ans=0
for vv in v:
  wa=1
  s=1
  while True:
    if vv<wa:
      break
    s+=1
    wa+=s
  ans+=(s-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())
fs = factorization(N)

if N == 1:
  print(0)

ans = 0
for f in fs:
  for e in range(1, f[1] + 1):
    z = f[0] ** e
    if N % z == 0:
      N //= z
      ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
from sys import exit
N = int(input())
if N == 1:
  print(0)
  exit()
ans = 0
n = N
counter = []
for i in range(2, int(N**0.5) + 2):
  if n % i == 0:
    counter.append(1)
    n = n // i
    while n % i == 0:
      counter[-1] += 1
      n = n // i
for c in counter:
  a = 1
  while c - a >= 0:
    c -= a
    a += 1
    ans += 1
print(1 if ans == 0 else 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

ans = 0
n= int(input())
if n==1:
    print(0)
else:
    for a,b in factorization(n) :
        for i in range(1,10**12):
            if b < i:
                break
            else:
                b -= i
                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

ans = 0
n= int(input())
if n==1:
    print(0)
else:
    for a,b in factorization(n) :
        for i in range(1,100000):
            if b < i:
                break
            else:
                b -= i
                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

ans = 0
n= int(input())
if n==1:
    print(0)
else:
    for a,b in factorization(n) :
        for i in range(1,1000):
            if b < i:
                break
            else:
                b -= i
                ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
def factor(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())
fs = factor(n)
ans = 0
for f in fs:
    for e in range(1, f[1]+1):
        z = f[0] ** e
        if n % z == 0:
            n //= z; ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
from math import sqrt
pf={}
m=int(input())
for i in range(2,int(m**0.5)+1):
    while m%i==0:
        pf[i]=pf.get(i,0)+1
        m//=i
if m>1:pf[m]=1
#print(pf)

cnt = 0
calc = lambda n: (sqrt(8 * n + 1) - 1) // 2
for i in pf:
    n = 1
    while i >= n:
        i -= n
        cnt += 1
        n += 1
#    cnt += calc(pf[i])
print(int(cnt))

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
n = N
counter = []
for i in range(2, int(N**0.5) + 2):
  if n % i == 0:
    counter.append(1)
    n = n // i
    while n % i == 0:
      counter[-1] += 1
      n = n // i
for c in counter:
  a = 1
  while c - a >= 0:
    c -= a
    a += 1
    ans += 1
print(1 if ans == 0 else ans)

Submission status: Wrong Answer

Solution code:
def fc(n):
    wk =0
    h=0
    for i in range(2,int(n**0.5)+1):
        if n%i==0:
            wk+=1
            n//=i
            h=i
    if n!=1 and h != n:
        wk+=1
    return wk

n =int(input())

print(fc(n))

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
n = N
counter = []
for i in range(2, int(N**0.5) + 1):
  if n % i == 0:
    counter.append(1)
    n = n // i
    while n % i == 0:
      counter[-1] += 1
      n = n // i
for c in counter:
  a = 1
  while c - a >= 0:
    c -= a
    a += 1
    ans += 1
print(1 if ans == 0 else ans)

Submission status: Wrong Answer

Solution code:
import math

def main():
    N = int(input())
    
    ans = 0
    n = 2
    ss = set()
    
    for i in range(2, int(math.sqrt(N))+1):
        if(N < n):
            break
        
        if(N%i == 0):
            ans += 1
            N = N//i
            n = i
            ss.add(i)
    
    if(N not in ss and N != 1):
        ans += 1
    
    if(ans == 0 and N != 1):
        print(1)
    else:     
        print(ans)
    
main()

Submission status: Wrong Answer

Solution code:
def divisor(n):
    res = []
    i = 1
    while i * i <= n:
        if n % i == 0:
            res.append(i)
            if(i != n // i) :
                res.append(n//i)
        i += 1
    res.sort()
    return res

n = int(input())

div = divisor(n)
ans = 0
for d in div:
    if d == 1:
        continue
    if n % d == 0:
        ans += 1
        n /= d

print(ans)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
p = []

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

p = prime_factorize(N)
# print(p)

p_out = {}
for i in range(len(p)):
  p_out[p[i]] = p_out.get(p[i], 0) + 1

# 素因数分解２（累乗に直す）
divident = []
for key, val in p_out.items():
  for i in range(val):
    divident.append(key ** (i + 1))

divident.sort()
# print('divident : ' + str(divident))

cnt = 0
# 小さい数から割って行く
for i in range(len(divident)):
  if N == 1: ## 1になったら割り切れない
    break
  elif N < divident[i]: # これ以上割れない
    print(cnt)
    quit()
  if N % divident[i] == 0:
    N /= divident[i]
    # print(N)
    cnt += 1

# N = 1でなければ大きい素数が残っているのでそれで割る
if N != 1:
  cnt += 1

print(cnt)

Submission status: Wrong Answer

Solution code:
import math

def prime_factrization(n):
    factor = []
    tmp = int(math.sqrt(n)) + 1
    for num in range(2,tmp):
        while n % num == 0:
            n //= num
            factor.append(num)

    if not factor:
        return 0
    else:
        if n != 1:
            factor.append(n)
        return list(factor)

ans = 0
N = int(input())
factor = prime_factrization(N)

if factor == 0:
    print(1)
else:
    for i in list(set(factor)):
        num = factor.count(i)
        j = 1
        a = 1
        while j <= num:
            ans += 1
            a += 1
            j += a
    print(ans)

Submission status: Wrong Answer

Solution code:
import math

def prime_factrization(n):
    factor = []
    tmp = int(math.sqrt(n)) + 1
    for num in range(2,tmp):
        while n % num == 0:
            n //= num
            factor.append(num)

    if not factor:
        return 0 # 素因数分解ができなければ0を返す
    else:
        if n != 1:
            factor.append(n)
        return list(factor)

ans = 0
N = int(input())
factor = prime_factrization(N)

if factor == 0:
    print(0)
else:
    for i in list(set(factor)):
        num = factor.count(i)
        j = 1
        a = 1
        while j <= num:
            ans += 1
            a += 1
            j = j + a
    print(ans)

Submission status: Wrong Answer

Solution code:
import math

def main():
    N = int(input())
    
    ans = 0
    n = 2
    
    for i in range(2, int(math.sqrt(N))+1):
        if(N < n):
            break
        
        if(N%i == 0):
            ans += 1
            N = N//i
            n = i
    
    if(ans == 0 and N != 1):
        print(1)
    else:     
        print(ans)
    
main()

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
p = []
N_const = N

# 計算量が必要なので工夫する
for i in range(2, int(math.sqrt(N)) + 1):
  if N % i == 0: # 割り切れた場合に追加
    p.append(i)
    
#print('p : ' + str(p))

# さっきので割り切れなければ自分自身でしか割り切れない
if len(p) == 0:
  print(1)
  quit()

cnt = 0  
p_out = {}
N = N_const
# 素因数分解（さっきので例えば４が入っていても、２で割り切れて到達しないはず）
for i in range(len(p)):
    while True:
      if N == 1: # 1になったら素数で割り切れない
        break
      if N % p[i] == 0:
        N /= p[i]
        if p_out.get(p[i]): # 既に辞書に登録されていればプラス１
          p_out[p[i]] = p_out.get(p[i]) + 1
        else: # 辞書に登録されていなければ新規で登録
          p_out[p[i]] = 1
      else:
        break # 割り切れなくなったら次の素数

#print('素数に変換した : ' + str(p_out))

# 素因数分解２（累乗に直す）
divident = []
for key, val in p_out.items():
  for i in range(val):
    divident.append(key ** (i + 1))

divident.sort()
#print('divident : ' + str(divident))

N = N_const
# 小さい数から割って行く
for i in range(len(divident)):
  if N == 1: ## 1になったら割り切れない
    break
  elif N < divident[i]: # これ以上割れない
    print(cnt)
    quit()
  N /= divident[i]
  cnt += 1

# N = 1でなければ大きい素数が残っているのでそれで割る
if N != 1:
  cnt += 1

print(cnt)

Submission status: Wrong Answer

Solution code:
pf={}
m=int(input())
for i in range(2,int(m**0.5)+1):
    while m%i==0:
        pf[i]=pf.get(i,0)+1
        m//=i
if m>1:pf[m]=1
#print(pf)

cnt = 0
a = []
a.append(0)
for i in range(1,30000):
    a.append(i + a[i-1])
#print(a)
for i in pf:
    s = pf[i]
    c = s
    if c in a:
        cnt += a.index(c)
    else:
        cnt += 1
    #print(c)
print(cnt)

Submission status: Wrong Answer

Solution code:
pf={}
m=int(input())
for i in range(2,int(m**0.5)+1):
    while m%i==0:
        pf[i]=pf.get(i,0)+1
        m//=i
if m>1:pf[m]=1
print(pf)

cnt = 0
a = []
a.append(0)
for i in range(1,30000):
    a.append(i + a[i-1])
#print(a)
for i in pf:
    s = pf[i]
    c = s
    if c in a:
        cnt += a.index(c)
    else:
        cnt += 1
    #print(c)
print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())

#素因数分解
def factorize_dict(n):
    b = 2
    fct = dict()
    while b * b <= n:
        while n % b == 0:
            n //= b
            #fct.append(b)
            if b not in fct:
                fct[b] = 1
            else:
                fct[b] += 1
        b = b + 1
    if n > 1:
        #fct.append(n)
        if n not in fct:
            fct[n] = 1
        else:
            fct[n] += 1
            
    return fct

factorized_N = factorize_dict(N)
print(factorized_N)

z_list = []

for f_dict in factorized_N.items():
    prime_number = f_dict[0]
    how_many = f_dict[1]
    z_list += [prime_number**i for i in range(1,how_many+1)]
    
z_list.sort(reverse=False)
print(z_list)

ans = 0
for z in z_list:
    if N%z == 0:
        ans += 1
        N /= z
        if N == 1:
            break
        
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

#素因数分解
def factorize_dict(n):
    b = 2
    fct = dict()
    while b * b <= n:
        while n % b == 0:
            n //= b
            #fct.append(b)
            if b not in fct:
                fct[b] = 1
            else:
                fct[b] += 1
        b = b + 1
    if n > 1:
        #fct.append(n)
        if b not in fct:
            fct[n] = 1
        else:
            fct[n] += 1
            
    return fct

factorized_N = factorize_dict(N)
print(factorized_N)

z_list = []

for f_dict in factorized_N.items():
    prime_number = f_dict[0]
    how_many = f_dict[1]
    z_list += [prime_number**i for i in range(1,how_many+1)]
    
z_list.sort(reverse=False)
print(z_list)

ans = 0
for z in z_list:
    if N%z == 0:
        ans += 1
        N /= z
        if N == 1:
            break
        
print(ans)

Submission status: Wrong Answer

Solution code:
pf={}
m=int(input())
for i in range(2,int(m**0.5)+1):
    while m%i==0:
        pf[i]=pf.get(i,0)+1
        m//=i
if m>1:pf[m]=1
#print(pf)

cnt = 0
a = []
a.append(0)
for i in range(1,10000):
    a.append(i + a[i-1])
#print(a)
for i in pf:
    s = pf[i]
    c = s
    if c in a:
        cnt += a.index(c)
    else:
        cnt += 1
    #print(c)
print(cnt)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
p = []
N_const = N

# 計算量が必要なので工夫する
for i in range(2, int(math.sqrt(N)) + 1):
  if N % i == 0: # 割り切れた場合に追加
    p.append(i)
    
#print('p : ' + str(p))

# さっきので割り切れなければ自分自身でしか割り切れない
if len(p) == 0:
  print(1)
  quit()

cnt = 0  
p_out = {}
N = N_const
# 素因数分解（さっきので例えば４が入っていても、２で割り切れて到達しないはず）
for i in range(len(p)):
    while True:
      if N == 1: # 1になったら素数で割り切れない
        break
      if N % p[i] == 0:
        N /= p[i]
        if p_out.get(p[i]): # 既に辞書に登録されていればプラス１
          p_out[p[i]] = p_out.get(p[i]) + 1
        else: # 辞書に登録されていなければ新規で登録
          p_out[p[i]] = 1
      else:
        break # 割り切れなくなったら次の素数

#print('素数に変換した : ' + str(p_out))

# 素因数分解２（累乗に直す）
divident = []
for key, val in p_out.items():
  for i in range(val):
    divident.append(key ** (i + 1))

divident.sort()
#print(divident)

N = N_const
# 小さい数から割って行く
for i in range(len(divident)):
  if N == 1: ## 1になったら割り切れない
    break
  N /= divident[i]
  cnt += 1

# N = 1でなければ大きい素数が残っているのでそれで割る
if N != 1:
  cnt += 1

#print('cnt : ' + str(cnt))
print(cnt)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
p = []
N_const = N

# 計算量が必要なので工夫する
for i in range(2, int(math.sqrt(N)) + 1):
  if N % i == 0: # 割り切れた場合に追加
    p.append(i)
    
print('p : ' + str(p))

# さっきので割り切れなければ自分自身でしか割り切れない
if len(p) == 0:
  print(1)
  quit()

cnt = 0  
p_out = {}
N = N_const
# 素因数分解（さっきので例えば４が入っていても、２で割り切れて到達しないはず）
for i in range(len(p)):
    while True:
      if N == 1: # 1になったら素数で割り切れない
        break
      if N % p[i] == 0:
        N /= p[i]
        if p_out.get(p[i]): # 既に辞書に登録されていればプラス１
          p_out[p[i]] = p_out.get(p[i]) + 1
        else: # 辞書に登録されていなければ新規で登録
          p_out[p[i]] = 1
      else:
        break # 割り切れなくなったら次の素数

print('素数に変換した : ' + str(p_out))

# 素因数分解２（累乗に直す）
divident = []
for key, val in p_out.items():
  for i in range(val):
    divident.append(key ** (i + 1))

divident.sort()
print(divident)

N = N_const
# 小さい数から割って行く
for i in range(len(divident)):
  if N == 1: ## 1になったら割り切れない
    break
  N /= divident[i]
  cnt += 1

# N = 1でなければ大きい素数が残っているのでそれで割る
if N != 1:
  cnt += 1

print('cnt : ' + str(cnt))
print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())

#素因数分解
def factorize_dict(n):
    b = 2
    fct = dict()
    while b * b <= n:
        while n % b == 0:
            n //= b
            #fct.append(b)
            if b not in fct:
                fct[b] = 1
            else:
                fct[b] += 1
        b = b + 1
    if n > 1:
        #fct.append(n)
        if b not in fct:
            fct[b] = 1
        else:
            fct[b] += 1
            
    return fct

factorized_N = factorize_dict(N)
#print(factorized_N)

z_list = []

for f_dict in factorized_N.items():
    prime_number = f_dict[0]
    how_many = f_dict[1]
    z_list += [prime_number**i for i in range(1,how_many+1)]
    
z_list.sort(reverse=False)
#print(z_list)

ans = 0
for z in z_list:
    if N%z == 0:
        ans += 1
        N /= z
        if N == 1:
            break
        
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0
for i in range(2,int(n**0.5)+1):
    count = 1
    loop = 1
    while n % i == 0:
        n = int(n/i)
        count -= 1
        if count == 0:
            ans += 1
            loop += 1
            count = loop
if n > 1:
    ans = 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0
for i in range(2,int(n**0.5)+1):
    count = 1
    loop = 1
    while n % i == 0:
        n = int(n/i)
        count -= 1
        if count == 0:
            ans += 1
            loop += 1
            count = loop
            print(str(n) + "," + str(i) + "," + str(ans)+","+str(i**loop))
if n > 1:
    ans = 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0
for i in range(2,int(n**0.5)+1):
    count = 1
    loop = 1
    while n % i == 0:
        n = int(n/i)
        count -= 1
        if count == 0:
            ans += 1
            loop += 1
            count = loop
            print(str(n) + "," + str(i) + "," + str(ans)+","+str(i**loop))
if n!=1:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0
for i in range(2,int(n**0.5)+1):
    count = 1
    loop = 1
    while n % i == 0:
        n = int(n/i)
        count -= 1
        if count == 0:
            ans += 1
            loop += 1
            count = loop
if ans == 0 and n > 1:
    ans = 1
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import Counter

def factors(n: int):
    l = [1]
    for i in range(2, int(n**0.5) + 1):
        #prime factorization
        while n % i == 0:
            n //= i
            l.append(i)
    if n > 1:
        l.append(n)
    return l

c = Counter(factors(int(input())))
ans = 0
for items,values in c.items():
    cnt = 1
    while cnt <= values:
        ans += 1
        cnt += 1
        values -= cnt
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0
for i in range(2,int(n**0.5)):
    count = 1
    while n % i == 0:
        n /= i
        count -= 1
        loop = 1
        if count == 0:
            ans += 1
            loop += 1
            count = loop
if ans == 0 and n > 1:
    ans = 1
print(ans)

Submission status: Wrong Answer

Solution code:
import collections

def primes(n): #試し割り法で各素因数とその指数を求める
 cnt=collections.defaultdict(int)
 for i in range(2,int(n**0.5)+1):
   if n%i==0:
     while n%i==0:
       cnt[i]+=1
       n//=i
 if n!=1:
   cnt[n]+=1
 return cnt

n=int(input())
cnt=primes(n)
ans=0
for key in cnt.keys():
    val=cnt[key]
    print(key,val)
    for i in range(100): #各素因数の指数について、k(k+1)//2<=(指数)を満たす最大のkを求める
        if (i*(i+1))//2>val:
            ans+=i-1
            break
print(ans)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
p = []
N2 = N

# 計算量が必要なので工夫する
for i in range(2, int(math.sqrt(N)) + 1):
  if N % i == 0: # 割り切れた場合に下記を実行
      p.append(i)
    
#print('p : ' + str(p))

# さっきので割り切れなければ自分自身でしか割り切れない
if len(p) == 0:
  print(1)
  quit()

cnt = 0  
p_out = {}

# 素因数分解（さっきので例えば４が入っていても、２で割り切れて到達しないはず）
for i in range(len(p)):
    while True:
      if N == 1: # 1になったら素数で割り切れない
        break
      if N % p[i] == 0:
        N /= p[i]
        if p_out.get(p[i]): # 既に辞書に登録されていればプラス１
          p_out[p[i]] = p_out.get(p[i]) + 1
        else: # 辞書に登録されていなければ新規で登録
          p_out[p[i]] = 1
      else:
        break # 割り切れなくなったら次の素数

#print('素数に変換した : ' + str(p_out))

# 素因数分解２（累乗に直す）
divident = []
for key, val in p_out.items():
  for i in range(val):
    divident.append(key ** (i + 1))

divident.sort()
#print(divident)

# 小さい数から割って行く
for i in range(len(divident)):
  if N2 == 1: ## 1になったら割り切れない
    break
  N2 /= divident[i]
  cnt += 1

#print('cnt : ' + str(cnt))
print(cnt)

Submission status: Wrong Answer

Solution code:
import math

# 素数を求める

N = int(input())
p = []
N_sqrt = int(math.sqrt(N)) + 1
N2 = N

# 計算量が必要なので工夫する
for i in range(2, N_sqrt):
  if N % i == 0: # 割り切れた場合に下記を実行
      p.append(i)
    
#print('p : ' + str(p))

if len(p) == 0:
  cnt = 1
  print(cnt)
  quit()
  
cnt = 0
p_out = {}

for i in range(len(p)):
    while True:
      if N == 0:
        break
      if N % p[i] == 0:
        N /= p[i]
        if p_out.get(p[i]): # 既に辞書に登録されていればプラス１
          p_out[p[i]] = p_out.get(p[i]) + 1
        else: # 辞書に登録されていなければ新規で登録
          p_out[p[i]] = 1
      else:
        break # 割り切れなくなったら次の素数

  
#print('素数に変換した : ' + str(p_out))

divident = []
for key, val in p_out.items():
  for i in range(val):
    divident.append(key ** (i + 1))

#print(divident)

# 並び替える

divident.sort()

# 小さい数から割って行く

for i in range(len(divident)):
  if N2 == 1:
    break
  N2 /= divident[i]
  cnt += 1

print('cnt : ' + str(cnt))

Submission status: Wrong Answer

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


def get_knu(a):
    n = 2
    while True:
        knum = (n * (n + 1)) // 2
        if a >= knum:
            n += 1
        else:
            return n - 1


D = int(input())
p = get_prime_fact(D)

if len(p) != len(set(p)):
    res = 0
    for n in set(p):
        count = p.count(n)
        if count == 1:
            res += 1
        else:
            add = get_knu(count)
            res += add

            print(n, add)

    print(res)
else:
    print(len(p))

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

l=factorization(n)

ans=0
cnt=1
if n==1:
  print(0)
else:
  for i,e in l:
    cnt=1
    while(cnt<=e):
      e-=cnt
      ans+=1
      cnt+=1

print(ans)

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])
    return arr

l=factorization(n)

ans=0
cnt=1
if n==1:
  print(0)
else:
  for i,e in l:
    cnt=1
    while(cnt<=e):
      e-=cnt
      ans+=1
      cnt+=1
print(ans)

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])
    return arr

l=factorization(n)

ans=0
cnt=1
if n==1:
  print(0)
else:
  for i,e in l:
    cnt=1
    if e==1:
      ans+=1
      continue
    while(cnt<=e):
      e-=cnt
      ans+=1
      cnt+=1
print(ans)

Submission status: Wrong Answer

Solution code:
from queue import deque
from math import log2

MAX_NUM = 10**16

N = int(input())

primenum = []

for i in range(2, int(log2(N))+1):
    for n in primenum:
        if i % n == 0:
            break
    else:
        primenum.append(i)

kouho_num = set()

for n in primenum:
    for i in range(1, int(log2(MAX_NUM))+1):
        if n**i <= N:
            kouho_num.add(n**i)
        else:
            break

queue = deque([(N, 0, kouho_num)])

res = 0

while queue:
    divnum, countnum, pnum = queue.popleft()
    if divnum == 1:
        res = max(res, countnum)
        continue
    flag = 1
    for num in pnum:
        if divnum % num == 0:
            queue.append((divnum // num, countnum + 1, pnum - set([num])))
            flag = 0
    if divnum > 1 and flag:
        res = max(res, countnum + 1)
print(res)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

fact = set()
counter = 0

for i in range(2, int(math.sqrt(N))+1):
    if N % i != 0:
        continue
    powt = 0
    while N % i == 0:
        powt += 1
        N /= i
    fact.add((i, powt))

if N != 1:
    fact.add((N, 1))

for base, e in fact:
    for t in range(1, e+1):
        if t <= e:
            e -= t
            counter += 1
print(fact)
print(counter)

Submission status: Wrong Answer

Solution code:
def factorization(n):
    m=n
    counter_map={}
    for i in range(2, int(-(-n**0.5//1))+1):
        if n%i==0:
            n=n//i
            if i not in counter_map:
                counter_map[i]=1
            else:
                counter_map[i]+=1
        if i>int(m**(1/2)):
            counter_map[n]=1
    return counter_map


a=int(input())
b=factorization(a)
sum=0

for i in b.keys():
    counter=0
    for j in range(1,41):
        if b[i]>=1+(j+2)*(j-1)//2:
            counter=j
        else:
            break
    sum+=counter

print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
x = 0
a = []
for i in range(2, N + 1):
    b = 1
    l = len(a)
    for j in range(l):
        if (i % a[j]) == 0:
            b = 0
    a.append(i)
    if b == 1:
        i2 = i
        if N == 1:
            break
        while N % i2 == 0 & N != 1:
            N //= i2
            x += 1
            i2 *= i2
        i += 1
    else:
        continue
print(x)