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:
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



def pop(stack):
	return stack[0],stack[1:]

def push(stack,x):
	stack.append(x)
	s = set(stack)
	p = list(s)
	p.sort()
	return p

n = int(input())
#a = sympy.factorint(n)
a = factorization(n)
stack = []
temp = []
for i in a:
	stack.append(i[0])
	temp.append(i[0])

ans = 0
while 1 < n:
	v, stack = pop(stack)
	if n%v == 0:
		ans += 1
		n /= v
		if n <= v: break
		for i in temp:
			#print(i*v)
			stack = push(stack,i*v)
	else:
		continue
print(ans)

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):
        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
  
fact = factorization(n)
vals = []
for f in fact:
  for e in range(1, f[1]):
    vals.append(f[0]**e)
vals.sort()
if n==1:
  print(0)
else:
  ans = 0
  for d in vals:
    if n%d == 0:
      ans += 1
      n /= d
  print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N == 1:
  print(0)
  exit(0)
import math
import numpy as np
def seachPrimeNum(N):
  max = int(np.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum
target=min(1000000, N)
primenumbers=seachPrimeNum(target)
a=max(1000000007, N)
primenumbers.append(a)
cnts=[0] * 5
ans=0
for i in range(len(primenumbers)):
  for j in range(len(cnts)):
    cnt = j+1
    data = primenumbers[i]**cnt
    if N % data == 0:
      ans += 1
      N = N // data
print(ans)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
# A, B = [i for i in input().split()]
def is_prime(n):
    if n == 1:
        return False
    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True
i = 1
count = 0
n = N
while True:
    if n == 1:
        break
    if i > n:
        break
    if n % i == 0:
        if i == 1:
            if is_prime(n):
                count += 1
                n //= n
            i += 1
            continue
        x = i
        e = 1
        while True:
            x *= i
            if N % x != 0:
                break
            e += 1
        j_sum = 1
        j = 1
        while True:
            if j_sum <= e < j_sum + j+1:
                break
            j_sum += j
            j += 1
        count += j
        n //= i ** e
    i += 1
print(count)

Submission status: Wrong Answer

Solution code:
def prime_factorize(n):
    a = []
    i=1
    j=1
    while n % 2**i == 0 and a.count(2**i)==0:
        a.append(2**i)
        n //= 2**i
        i+=1
        
    f = 3
    while f * f <= n:
        if n % f**j == 0 and a.count(f**j)==0:
            a.append(f**j)
            n //= f**j
            j+=1
           
        else:
            f += 2
            j=1
    if n != 1:
        a.append(n)
    return a
N = int(input())
c = prime_factorize(N)

c=set(c)

print(len(c))

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
aaa = 2
maxi = 2
def prime(aaa):
    if n != 1:
        i = 2
        while i*i <= aaa:
            if aaa % i == 0:
                return False
            i += 1
        return True
    else:
        return False
def divisors(a, i):
    global ans, aaa, maxi
    while i*i <= n:
        if a % i == 0:
            ans += 1
            num = a / i
            aaa = num
            if maxi <= i:
                maxi = i
            divisors(num, i+1)
            break
        i += 1
def divisors2(a, i):
    global ans
    if True:
        y = 2
        while maxi >= y:
            if a == 0:
                break
            elif a % y == 0:
                a = a % y
                y -= 1
            y += 1
        if prime(a) and a >= maxi:
            ans += 1
if n == 1:
    print(0)
else:
    if prime(n):
        print(1)
    else:
        divisors(n, 2)
        divisors2(aaa, maxi + 1)
        print(ans)

Submission status: Wrong Answer

Solution code:
import math
import numpy as np
def primes(n):
    ass = []
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    for i in range(len(is_prime)):
        if is_prime[i]:
            ass.append(i)
    return ass
primelist=set(primes(10**6))

N=int(input())
if N==1:
    print(0)
    exit()
if N in primelist:
    print(1)
    exit()
N_SQ=math.sqrt(N)
target=N
ans=0
last=0
for i in range(2,int(N_SQ)+1):
    if target%i==0:
        for j in primelist:
            if j**math.log(i, j) == i:
                ans+=1
                target/=i
                last=i
                break
# if target!=1 and target!=last:
#     ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
from collections import defaultdict

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

count = 0
n = int(input())
d = defaultdict(int)
ans = prime_factorize(n)
for i in ans:
    d[i] += 1
for j in d.values():
        if j < 3:
            count +=1
        elif j < 6:
            count +=2
        elif j < 10:
            count +=3
        elif j < 15:
            count +=4
        elif j < 21:
            count +=5
        elif j < 28:
            count +=6
        elif j < 36:
            count +=7
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
counter = 0
half = n//2 +1
i = 2
while i <= n and i <= half:
  if n%i == 0:
    counter += 1
    n = n//i
  i += 1
print(counter)

Submission status: Wrong Answer

Solution code:
n = int(input())
res = 0
upper = 1e6
i = 2
lst = set()
if n < 2:
   print(res)
   exit()
while i <= upper:
   if n % i == 0 and i not in lst:
      n = n // i
      upper = min(upper, n)
      lst.add(i)
      res += 1
   i += 1
if upper == 1e6:
   res += 1

print(res)

Submission status: Wrong Answer

Solution code:
def div():
    n = int(input())
    count = 0
    for i in range(1,10):
        if n%i==0:
            count += 1
            if count == 2:
                break
    if count == 2:
        cnt = 0
        z = [31,29,27,25,23,19,17,16,13,9,8,7,5,4,3,2]
        z = z[::-1]
        for i in z:
            if n%i==0:
                cnt += 1
                n // i
    else:
        return 1
    return cnt

if __name__ == "__main__":
    print(div())

Submission status: Wrong Answer

Solution code:
from math import floor, sqrt


def func(x):
    return floor((sqrt(1 + 8 * x) - 1) / 2)


N = int(input())
limit = floor(sqrt(N))

primes = [2]

count = 0
flag = True
p = 2
while 1:
    #print(p,N)
    isprime = True
    if N == 1:
        break
    if p > sqrt(N):
        count += 1
        break
    if p > 3:
        for i in primes:
            if i >= sqrt(p):
                break
            if p % i == 0:
                isprime = False
                break
        if not isprime:
            p += 2
            continue
        primes.append(p)
    a = 0
    while N % p == 0:
        #print("while",p, a)
        a += 1
        N = N // p
    count += func(a)
    p += 2
print(count)

Submission status: Wrong Answer

Solution code:
import math
def sosu(n):
    sosu=1
    if n==1:
        sosu=0
    sq=int(math.sqrt(n))
    for x in range(2,sq+2):
        if n%x==0 and x<n:
            sosu=0
            break
    return sosu
n=int(input())
noso=[]
count=0
if n==1:
    count=0
elif sosu(n)==1:
    count=1
else:
    for x in range(2,int(n/2)+2):
        if x>n:
            break
        if x in noso:
            pass
        elif x<=10:
            xx=x
            while n%xx==0:
                noso.append(xx)
                count+=1
                n=n/xx
                xx=xx*x
        elif x>11:
            xx=x
            while n%xx==0:
                noso.append(xx)
                count+=1
                n=n/x
                xx=xx*x
print(count)

Submission status: Wrong Answer

Solution code:

n = int(raw_input())
 
def f(c):
	stack = []   
	cumul = 0
	step = 1
	while(cumul < c):
		stack.append(step)
		cumul += step
		step += 1
	while(cumul != c):
		cumul -= stack.pop()
		cand = c - (stack[-1] if stack else 0)
		if cand > (stack[-1] if stack else 0):
			stack.append(cand)
			cumul += cand

	return len(stack)

d = 2
count = 0

for d in range(2, int(n ** 0.5) + 2):
	if n%d==0:
		c = 0
		while(n%d == 0): 
			c += 1
			n /= d
		count += f(c)
	if n == 1:
		break
if n != 1:
	print 1
else:
	print count

Submission status: Wrong Answer

Solution code:
n = int(input())
a = {}
max_count = 0
while n % 2 == 0:
    if 2 in a:
        a[2] += 1
    else:
        a[2] = 1
#    a.append(2)
    n //= 2
    max_count += 1

f = 3
while f * f <= n:
    if n % f == 0:
        if f in a:
            a[f] += 1
        else:
            a[f] = 1
        n //= f
    else:
        f += 2

if f > 1:
    if f in a:
        a[f] += 1
    else:
        a[f] = 1

cnt = 0
for k, v in a.items():
    d = 1
    while (v - d >= 0):
        v = v - d
        d +=1
        cnt += 1

print(cnt)

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
    
a=factorization(int(input()))

b=[1,3,6,10,15,21,28,36]

ans=0

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

for i in a:
    for j in range(len(b)):
        if i[1]<b[j]:
            ans+=j
            break
    
print(ans)

Submission status: Wrong Answer

Solution code:
import collections
import math


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


def main():
    N = int(input())
    list_factorize = prime_factorize(N)
    c = collections.Counter(list_factorize)
    list_key = list(c.keys())
    list_count = list(c.values())
    ans = 0
    for i in range(0, len(list_key)):
        num = list_count[i]
        ans += math.floor(math.sqrt(num+1))
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a = 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
    
li = factorization(a)
ct = 0
d = 0
ran = range(1,1000)
for i,j in li:
    ctb = 0
    for k in ran:
        if ctb >= j:
            d = k-1
            break
        ctb += k
    ct += d

print(ct)

Submission status: Wrong Answer

Solution code:
import itertools

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 for x in range(cnt)])

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

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

    return arr

ret = factorization(N)
L = list(itertools.chain.from_iterable(ret))
if 1 in L:
    L.remove(1)

cnt = 0
mem = []
MAX_n = max(L)
e = 0
while True:
    e += 1
    flg = 0
    for l in set(L):
        if N <= l**e:
            flg += 1

    if len(L) == 0:
        break
    for p in set(L):
        z = p**e
        q,mod = divmod(N,z)
        if mod == 0 and (z not in mem):
            N = q
            for x in range(e):
                L.remove(p)
            mem.append(z)
            #print(z,N,mod,L)
            cnt += 1
            break

    if flg == len(set(L)):
        break

print(cnt)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
if n == 1:
    print(0)
    exit()
def makeprime(value):
    flag  = [True for _ in range(value)]
    ans = []
    for i in range(1,len(flag)):
        if flag[i]:
            ans.append(i+1)
            for j in range(i,len(flag),i+1):
                flag[j] = False
    return ans
for i in range(2,int(math.sqrt(n)+1)):
    if n%i == 0:
        flag = 1
        break
else:
    flag = 0
if flag:
    r = n
    ans = 0
    rem = makeprime(int(math.sqrt(n)))
    for i in rem:
        o = 1
        while (i**o <= n):
            if n%i**o == 0:
                ans += 1
                n //= i**o
            o += 1
    print(ans)
else:
    print(1)

Submission status: Wrong Answer

Solution code:
N = int(input())
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
l = make_divisors(N)
count = 0
for i in l:
    if N % i == 0:
        N //= i
        count += 1
print(count-1)

Submission status: Wrong Answer

Solution code:
n = int(input())

def get_primenumber(N):
    prime_list = [2]
    for num in range(3,N+1,2):
      if all( num % prime != 0 for prime in prime_list):
        prime_list.append(num)

    return prime_list

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

pri = get_primenumber(10000)

l = []
for z in make_divisors(n):
  if n == 1:
    break
  if n == z:
    l.append(z)
    break
  for i in reversed(pri):
    for e in range(1,5):
      if z < i**e:
        break
      if z == i**e:
        if n%z == 0:
          l.append(z)
          n = int(n/z)
          if n == 1:
            print(l)
            exit()
        
print(len(l))

Submission status: Wrong Answer

Solution code:
import math,sys
ans=0
def factorization(n):
    num=0
    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])
            num=num+1
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr,num
def kirisute(n):
    p=(-1+math.sqrt(1+8*n))/2
    q=math.floor(p)
    return q
N=int(input())
if N==1:
  print(0)
soinsuu,jigen=factorization(N)
for i in range(len(soinsuu)):
  ans=ans+kirisute(soinsuu[i][1])
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
n = int(N ** (1/2) + 1)
ans = 0
nums = [N]
for i in range(2, n + 1):
  if N != 1 and N !=0 and N % i == 0:
    ans += 1
    if N//i != i:
      nums.append(N//i)
    N //= i
for num in sorted(nums):
  if N != 1 and N != 0 and N % num == 0:
    ans += 1
    N //= i
  
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
divs = []
for i in range(1, int(n ** 0.5) + 1):
  if n % i == 0:
    divs.append(i)
    if i != n // i:
      divs.append(n // i)
a = sorted(divs)
ea = a[1:]
count = 0
for i in range(len(ea)):
  t = n / ea[i]
  if t.is_integer() == False:
    continue
  else:
    n /= ea[i]
    count += 1
  if n == 1:
    break
print(count)

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())
S=0
if n>1:
    l=factorization(n)
    for k in l:
        x=k[1]
        t=1
        while t*(t+1)<2*x:
            t+=1
        S+=t
    print(S)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
from decimal import *
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())
li = []
for i in factorization(n):
    ran = range(i[1]+1)
    sum = 0
    s = 0
    ss = 1
    for j in ran:
        sum += 1
        if sum > s:
            li.append(i[0]**(j))
            s = ss + s
            ss += 1
ans = 1
count = 0
for i in sorted(set(li)):
    n = int(Decimal(str(n)) // Decimal(str(i)))
    count += 1
    if ans == n:
        break
print(count-1)

Submission status: Wrong Answer

Solution code:
import math
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
for i in pf:
    s = pf[i]
    cnt +=1
    c = s
    while c > 1:
        cnt += 1
        c = math.floor(c / 2)
        #print(c)
print(cnt)

Submission status: Wrong Answer

Solution code:
import math

def primefact(n):
	facts = {}
	prime = True
	while n > 1:
		for d in range(2,int(math.sqrt(n))+1):
			while n%d == 0:
				if d in facts:
					facts[d] += 1
				else:
					facts[d] = 1
				n /= d
				prime = False
				break
		if prime:
			facts[n] = 1
			n = 1
		prime = True
	return facts

n = int(input())
count = 0
facts = primefact(n)
for key,value in facts.items():
	if value < 3:
		count += 1
	elif value < 6:
		count += 2
	elif value < 10:
		count += 3
	elif value < 15:
		count += 4
	elif value < 21:
		count += 5
	elif value < 28:
		count += 6
	else:
		count += 7
print(count)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
import math

N= int(input().rstrip('\n'))
M=N
lim = math.floor(math.sqrt(N))+10
res = 0
pri=[2]
for i in range(2,lim+1):
  if all(i % x != 0 for x in pri) or i==2:
    if N % i ==0:
      pri.append(i)
      add = 1
      pl = 1
      n = N // i
      while n%i==0:
        pl += 1
        n = n // i
        if pl==((add+1)*(add+2)/2):
          add += 1
      res += add
if M == N and N>1:
  res += 1
print(res)

Submission status: Wrong Answer

Solution code:
import math
 
def is_prime(n):
    if n == 1: return False
 
    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
 
    return True
 
def gen_list_n_removed(l, n):
    return [i for i in l if i != n]

def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]
 
 
N = int(input())
 
num_list = set()
 
hoge = primes(10000000)
 
for i in range(1, 30):
    for j in hoge:
        res = j ** i
        if res > 10 ** 12:
            break
        num_list.add(j ** i)
 
num_list = sorted(num_list)
 
if is_prime(N):
    print(1)
    exit(0)
 
count = 0
while True:
    for i in num_list:
        if N % i == 0:
            N = N / i
            count += 1
            num_list = gen_list_n_removed(num_list, i)
            break
        if i == num_list[-1]:
            print(count)
            exit(0)

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

z = factorization(int(input()))
if z[0][1] == 1 :
    print(0)
    exit()
i = 1
ans = 0
flag = True
while flag:
    flag2 = False
    for j in range(len(z)):
        if z[j][1] >= i :
            z[j][1] -= i
            ans += 1
            flag2 = True

    i += 1
    if flag2 == False: flag = False
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
c=0

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

for i in factorization(n):
  for j in range(1,100000):
    if (j-1)*j<=2*i[1]<j*(j+1):
      c+=j-1
print(c)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

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

def Fib(n):
    a, b = 0, 1
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n-2):
            a, b = b, a + b
        return b

N = int(input())
if(N == 1):
    print(0)
else:
    fact = factorization(N)
    l = [Fib(n) for n in range(3,100)]
    count = 0
    d = {}
    for n in fact:
        num = n[1]
        for f in l:
            num -= f
            if(num < 0):
                break
            count += 1
    print(count)

Submission status: Wrong Answer

Solution code:
import itertools
n=int(input())
c=0
A=[]
for i in range(2,int(n**0.5+1)):
  if n%i==0:
    a=0
    while(n%i==0):
      n//=i
      a+=1
    A.append(a)
l=len(A)
i=1
while(sum(A)>=l and l>0):
  for j in itertools.combinations_with_replacement(range(l), i):
    for k in j:
      if A[k]<1:
        break
    else:
      for k in j:
        if A[k]==0:
          break
        else:
          A[k]-=1
      else:
        c+=1
  B=[]
  for a in A:
    if a!=0:
      B.append(a)
  A=B
  l=len(A)
  i+=1
print(c)

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

def co(n):
  i=1
  c=0
  while True:
    n=n-i
    #print(n)
    if n>=0:
      c+=1
    else:
      break
    i+=1
  return c

a=factorization(n) 
#print(a)

ans=0
for i,j in a:
  ans += co(j)

print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
# a=int(input())
#A,B=map(str,input().split(" "))
#A=int(A)
#B=int(float(B)*100)

a=[]
for number1 in range(2,1000):
    count=0
    for number2 in range(1,number1):
            number=number1%number2
            if number==0:
                count+=1
    if count==1:
        a.append(number1)
b=a

for i in a:
  tmp = i
  while i < 10000000000000:
    i *= tmp
    b.append(i)

#print(b)
        

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

count=0
for i in b:
  if N <= 1:
    break
  if N % i == 0:
    N /= i
    count += 1
  #print(i,N, count)

if N == 1:
  print(count)
else:
  print(count+1)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

import math
n = math.floor(math.sqrt(N)) + 1

cm = []
for i in range(2, n+1):
    if (N % i != 0):
        continue
    
    ex = 0
    while (N % i == 0):
        ex += 1
        N //= i
        
    cm.append([i, ex])
    
if len(cm) == 0:
    print(1)
    exit()
        
#print(cm)

su = [0] * 1000
s = 0
for i in range(1, 40+1):
    s += i
    su[s] = i

f = 0
for i in range(1000):
    if su[i] == 0:
        su[i] = f
    else:
        f = su[i]

count = 0
for i in cm:
    #print(i)
    #print(i[1])
    count += su[i[1]]

print(count)

Submission status: Wrong Answer

Solution code:
import sys
import copy
import collections

# 素因数分解の結果をlistで返す
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

def main():
    n = int(input())
    n_prime = prime_factorize(n)
    unique_n_prime = []
    unique_n_prime = [x for x in n_prime if x not in unique_n_prime and not unique_n_prime.append(x)]

    ans = 0
    ans += len(unique_n_prime)

    unique_c = collections.Counter(unique_n_prime)

    c = collections.Counter(n_prime)
    c = c - unique_c
    t = 1
    while len(c) > 0:
        c = c - unique_c
        ans += len(c)

        for _ in range(t):
            c = c - unique_c

        t += 1

    print(ans)



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
import collections


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


n = int(input())
l = trial_division(n)
if n == 1:
    print(0)
    exit(0)
if l == -1:
    print(1)
    exit(0)
if l[len(l) - 1] == 1:
    l = l[:-1]
c = collections.Counter(l)

print('debug')
ans = 0
for k, v in c.items():
    s = 1
    for i in range(1, v):
        if i * (i + 1) <= v * 2:
            s = max(s, i)
    ans += s
print(ans)

Submission status: Wrong Answer

Solution code:
#4問目
import math
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

def has_duplicates2(seq):
    seen = []
    unique_list = [x for x in seq if x not in seen and not seen.append(x)]
    return len(seq) != len(unique_list)

fact = prime_factorize(N)
result  =  0
if has_duplicates2(fact):
    #重複した数字のリスト
    chofuku = [x for x in set(fact) if fact.count(x) > 1]
    for i in chofuku:
        Count = fact.count(i)
        if(Count == 3):
            result += 2
        else:
            result += math.floor(Count / 2)
    
    #重複していない数の個数
    NOTchofuku = len((list(set(fact)))) - len(chofuku)
    print(result + NOTchofuku)
else:
    print(len(fact))

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())
total = 0
if n == 1:
    print("0")
else:
    for i in factorization(n):
        t = 1
        while 1:
            if i[1]-t < 0:
                break
            else:
                total += 1
                i[1] -= t
                t += 1
print(total)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import math

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

# n の約数を全部並べる
for i in range(1, int(math.sqrt(n))+1):
    if n%i == 0:
        div.append(i)
        div.append(n//i)

div = list(sorted(set(div)))
#print('div =', div)
ans = 0 

for i in range(1, len(div)):
    if int(n) == 1:
        break
    if div[i] != 1:
        if n%div[i] == 0:
            n /= div[i]
            for j in range(len(div)):
                if div[j]%div[i] == 0:
                    div[j] /= div[i]
            ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
re = 0
if n == 1:
    print(0)
else:
    li = []
    for i in range(2, int(math.sqrt(n))+1):
        i2 = 1
        while n % (i**i2) == 0:
            if (i**i2) not in li:
                re += 1
                n = n/(i**i2)
                li.append(i**i2)
            i2 += 1
    if re == 0:
        print(1)
    else:
        print(re)

Submission status: Wrong Answer

Solution code:
n=int(input())
p=2
e=1
k=0
while n!=1:
    while n%p!=0:
        p+=1
        e=1
    z=p**e
    n//=z
    e+=1
    k+=1
print(k)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

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

def calc(i):
  c = 1;
  acc = 0;
  count = 0
  while acc <= i:
    c += c+1
    acc += c
    count+=1
  return count;

def main():
  n = int(input())
  if(n==1):
    print(0)
    return;
  facts = prime_factorize(n)
  
  count = 0
  for fact in facts:
    count += calc(facts[fact])
  print(count)

main()