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:
import numpy as np
import sys
sys.setrecursionlimit(10**6)

n=int(input())

m=int(np.sqrt(n))+1

if n==1 or n==0:
    print(0)
    exit()

ans=0
for i in range(2,m):
    cnt=0
    for j in range(44):
        if n%i==0:
            n=n/i
            print("i=",i,"n=",n)
            cnt+=1
        else:
            break
    if 1<=cnt<3:
        ans+=1
    if 3<=cnt<6:
        ans+=2
    if 6<=cnt<10:
        ans+=3
    if 10<=cnt<15:
        ans+=4
    if 15<=cnt<21:
        ans+=5
    if 21<=cnt<28:
        ans+=6
    if 28<=cnt<36:
        ans+=7
    if 36<=cnt<45:
        ans+=8

if n!=1:
    ans+=1

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

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0
temp = N
fact = []

if N == 1:
    print(0)
    exit()
for i in range(2, int(N ** 0.5 + 2)):
    if temp % i == 0:
        n = 0
        while temp % i == 0:
            temp //= i
            n += 1
        fact.append(n)

ans = 0
for f in fact:
    i = 0
    while i * (i+1) <= 2 * f:
        i += 1
    ans += i - 1

print(max(ans, 1))

Submission status: Wrong Answer

Solution code:
# Nまでの素数を全て出す
# 素数をすべて出す
# 小さい順から
import math
N = int(input())
s = {}

for i in range(2, math.ceil(math.sqrt(N))):
    mod = N % i
    while mod == 0:
        s[i] = s.get(i, 0) + 1
        N = N // i

        if N == 0:
            break

        mod = N % i
if not N == 1:
    s[N] = s.get(N, 0) + 1

count = 0
for prime in s:
    pow = s[prime]

    n = 1
    while pow >= n:
        if pow == n*(n+1)/2:
            count += n
            break
        if pow < n*(n+1)/2:
            count += n-1
            break
        n += 1

print(s)
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0
temp = N
fact = []

if N == 1:
    print(0)
    exit()
for i in range(2, int(N ** 0.5 + 1)):
    if temp % i == 0:
        n = 0
        while temp % i == 0:
            temp //= i
            n += 1
        fact.append(n)

ans = 0
for f in fact:
    i = 0
    while i * (i+1) <= 2 * f:
        i += 1
    ans += i - 1

print(max(ans, 1))

Submission status: Wrong Answer

Solution code:
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
 
 
a = int(input())
count = 0
c = [1]
while True:
    
    b = make_divisors(int(a))
    if a == 1:
        break
    count += 1
    for i in c:
        if i in b:
            b.remove(i)
    if b == []:
        pass
    else:
        c.append(b[0])
        a /= b[0]
print(count)

Submission status: Wrong Answer

Solution code:
from sys import stdin

def waru(a,b):
  if a%b != 0:
    return 0
  if a/b == 1:
    return b
  return waru(a/b,b)
  

def main():
  s = []
  read = stdin.readline
  N =int(read())
  count = 0
  start = 2
  while(1):
    if N < start:
      break
    for i in range(start,N+1):
      if N%i == 0:
        if len(s) != 0:
          for j in s:
            if j != waru(i,j):
              continue
        count += 1
        s += [i]
        N = N//i
        start = i+1
        break
  print(count)
        
      

  
  
  
if __name__ == "__main__":
  main()

Submission status: Wrong Answer

Solution code:
from sys import stdin

def main():
  read = stdin.readline
  N =int(read())
  count = 0
  start = 2
  while(1):
    if N < start:
      break
    for i in range(start,N+1):
      if N%i == 0:
        count += 1
        N = N//i
        start = i+1
        break
  print(count)
        
      

  
  
  
if __name__ == "__main__":
  main()

Submission status: Wrong Answer

Solution code:
from sys import stdin

def main():
  read = stdin.readline
  N =int(read())
  count = 0
  start = 2
  while(1):
    if N <= start:
      break
    for i in range(start,N+1):
      if N%i == 0:
        count += 1
        N = N//i
        start = i+1
        break
  print(count)
        
      

  
  
  
if __name__ == "__main__":
  main()

Submission status: Wrong Answer

Solution code:
# 素因数分解
# O(N**0.5)
def p_bunkai(N):
    ret = []
    for i in range(2, int(N ** 0.5) + 1):
        if N % i == 0:
            count = 0
            while N % i == 0:
                N //= i
                count += 1
            ret.append((i, count))
    if N != 1:
        ret.append((N, 1))
    return ret

N = int(input())

ans = 0
for _, i in p_bunkai(N):
    j = 1
    while True:
        if i >= j:
            ans += 1
            i -= 1
            j += 1
        else:
            break
print(ans)

Submission status: Wrong Answer

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

p = []
i = 2
while i <= int(math.sqrt(N))+1:
  if N%i == 0:
    p.append(i)
    N = int(N/i)
    i += 1
  else:
    i += 1
if N != 1:
  p.append(N)
print(len(p))

Submission status: Wrong Answer

Solution code:


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]


N = int(input())
div = make_divisors(N)
# print(div)
if N == 1:
    print(0)
    exit()

div.remove(1)
# print(div)
ans = 0
for par in div:
    _ans = 0
    _N = N / par
    _ans += 1
    for elme in div:
        if (_N % elme == 0 and elme != par):
            _N = _N / elme
            _ans += 1
    ans = max(_ans, ans)

print(ans)

Submission status: Wrong Answer

Solution code:


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]


N = int(input())
div = make_divisors(N)
# print(div)
if N == 1:
    print(0)
    exit()

div.remove(1)
# print(div)

ans = 0
for elme in div:
    if (N % elme == 0):
        N = N / elme
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
def primeNumber(n):
    li = []
    if n == 1:
        return li
    if n == 2:
        return [2,]
    if n == 3:
        return [3,]
    else:
        for i in range(2,n):
            if i*i > n:
                if n != 1:
                    li.append(n)
                return li
            else:
                while n%i == 0:
                    li.append(i)
                    n = int(n/i)
"""
for i in range(30):
    print(primeNumber(i))
"""

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

li = primeNumber(n)
#print(li)

#print(li)
count = 1
ans_li = []
tmp0 = li[0]
for i in range(1,len(li)):
    tmp = li[i]
    if tmp0 != tmp:
        ans_li.append(count)
        tmp0 = tmp
        count = 1
    else:
        count += 1
ans_li.append(count)
#print(ans_li)
   
ans = 0
for i in range(len(ans_li)):
    a = ans_li[i]
    n = 0
    while True:
        if n+1 > a:
            break
        n += 1
        a = a - n

        
    ans += n 
    print(ans)
        
print(ans)

Submission status: Wrong Answer

Solution code:
import math

def main():
    N = int(input())
    limit = int(math.sqrt(N)+1)
    count = 0
    if N == 1: 
        print(0) 
        exit(0)
    for i in range(2,limit):
        if N%i==0:
            N/=i
            count += 1
    if count == 0:
        count+=1
    print(count)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
li = []
flg = 0
for i in range(1000000):
  if n==1:
    break
  if i==0 or i==1 or n%i!=0:
    continue
  j = i
  cnt = 0
  while(n%j==0):
    print(n)
    print(j)
    if flg==0:
      flg = 1
    n /= j
    cnt += 1
  li.append(cnt)
if flg==0 and n!=1:
  print(1)
elif flg==0 and n==1:
  print(0)
elif n==1:
  ans = 0
  for e in li:
    i = 1
    while(e-i>=0):
      e -= i
      i += 1
      ans += 1
  print(ans)
else:
  ans = 1
  for e in li:
    i = 1
    while(e-i>=0):
      e -= i
      i += 1
      ans += 1
  print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
li = []
flg = 0
for i in range(1000000):
  if n==1:
    break
  if i==0 or i==1 or n%i!=0:
    continue
  j = i
  cnt = 0
  while(n%j==0):
    if flg==0:
      flg = 1
    n /= j
    cnt += 1
  li.append(cnt)
if flg==0 and n!=1:
  print(1)
elif flg==0 and n==1:
  print(0)
else:
  ans = 0
  for e in li:
    i = 1
    while(e-i>=0):
      e -= i
      i += 1
      ans += 1
  print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
li = []
flg = 0
for i in range(1000000):
  if n==1:
    break
  if i==0 or i==1 or n%i!=0:
    continue
  j = i
  cnt = 0
  while(n%j==0):
    if flg==0:
      flg = 1
    n /= j
    cnt += 1
  li.append(cnt)
if flg==0 and n!=1:
  print(1)
elif n==1:
  print(0)
else:
  ans = 0
  for e in li:
    i = 1
    while(e-i>=0):
      e -= i
      i += 1
      ans += 1
  print(ans)

Submission status: Wrong Answer

Solution code:
import math
def get_prime(n):
    if n <= 1:
        return []
    prime = [2]
    if n > 2:
        limit = int(math.sqrt(n))
        odd = [i for i in range(3, n + 1, 2)]
        while limit >= odd[0]:
            prime.append(odd[0])
            odd = [j for j in odd if j % odd[0] != 0]
        prime += odd
    return prime

from collections import defaultdict
def prime_factorization(n):
    if n <= 1:
        return {}
    else:
        # print(int(math.sqrt(n)))
        prime = get_prime(int(math.sqrt(n)))
        dct = defaultdict(int)
        for p in prime:
            while n % p == 0:
                dct[p] += 1
                n //= p
        if n != 1:
            dct[n] += 1
        dct = dict(dct)
        return dct

n = int(input())
pf = prime_factorization(n)

Z = []
for k, v in pf.items():
    for i in range(1, v + 1):
        Z.append(k ** i)
Z.sort()
count = 0
for z in Z:
    if n < z:
        count += 1
        n //= z


print(count)

Submission status: Wrong Answer

Solution code:
from itertools import accumulate


def main():
    n = int(input())
    acc = tuple(accumulate(range(1, 42)))  # 10^12 < 2^39

    f = 2
    count = 0
    ans = 0
    while n % f == 0:
        n //= f
        count += 1
    for accum_index, x in enumerate(acc):
        if count < x:
            ans += accum_index
            break

    f = 3
    count = 0
    while f * f <= n:
        if n % f == 0:
            n //= f
            count += 1
        else:
            for accum_index, x in enumerate(acc):
                if count < x:
                    ans += accum_index
                    break
            f += 2
            count = 0
    if n != 1:
        ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def primeNumber(n):
    li = []
    if n == 1:
        return li
    if n == 2:
        return [2,]
    if n == 3:
        return [3,]
    else:
        for i in range(2,n):
            if i*i > n:
                if n != 1:
                    li.append(n)
                return li
            else:
                while n%i == 0:
                    li.append(i)
                    n = int(n/i)
"""
for i in range(30):
    print(primeNumber(i))
"""

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

li = primeNumber(n)

#print(li)
count = 1
ans_li = []
tmp0 = li[0]
for i in range(1,len(li)):
    tmp = li[i]
    if tmp0 != tmp:
        ans_li.append(count)
        tmp0 = tmp
        count = 1
    else:
        count += 1
ans_li.append(count)
#print(ans_li)
   
ans = 0
for i in range(len(ans_li)):
    a = ans_li[i]
    c = 1
    for j in range(1,1000):
        c += j
        if a > c:
            continue
        else:
            ans += j
            break

print(ans)

Submission status: Wrong Answer

Solution code:
def primeNumber(n):
    li = []
    if n == 1:
        return li
    if n == 2:
        return [2,]
    if n == 3:
        return [3,]
    else:
        for i in range(2,n):
            if i*i > n:
                if n != 1:
                    li.append(n)
                return li
            else:
                while n%i == 0:
                    li.append(i)
                    n = int(n/i)
"""
for i in range(30):
    print(primeNumber(i))
"""

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

li = primeNumber(n)

#print(li)
count = 1
ans_li = []
tmp0 = li[0]
for i in range(1,len(li)):
    tmp = li[i]
    if tmp0 != tmp:
        ans_li.append(count)
        tmp0 = tmp
        count = 1
    else:
        count += 1
ans_li.append(count)
#print(ans_li)
   
ans = 0
for i in range(len(ans_li)):
    a = ans_li[i]
    c = 1
    for j in range(1,50):
        c += j
        if a > c:
            continue
        else:
            ans += j
            break

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())
S = []
fac = factorization(N)
for i in range(len(fac)):
  S.append(fac[i][1])
ans = 0
for i in range(len(S)):
  for j in range(1,S[i] + 1):
    if S[i] - j <= 0:
      break
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import math
def get_prime(n):
    if n <= 1:
        return []
    prime = [2]
    if n > 2:
        limit = int(math.sqrt(n))
        odd = [i for i in range(3, n + 1, 2)]
        while limit >= odd[0]:
            prime.append(odd[0])
            odd = [j for j in odd if j % odd[0] != 0]
        prime += odd
    return prime

from collections import defaultdict
def prime_factorization(n):
    if n <= 1:
        return {}
    else:
        # print(int(math.sqrt(n)))
        prime = get_prime(int(math.sqrt(n)))
        dct = defaultdict(int)
        for p in prime:
            while n % p == 0:
                dct[p] += 1
                n //= p
        if n != 1:
            dct[n] += 1
        dct = dict(dct)
        return dct

n = int(input())
pf = prime_factorization(n)

Z = []
for k, v in pf.items():
    for i in range(1, v + 1):
        Z.append(k ** i)
Z.sort()
count = 0
for z in Z:
    if n < z:
        count += 1
        n //= z
    if n == 1:
        break

print(count)

Submission status: Wrong Answer

Solution code:
import math
def get_prime(n):
    if n <= 1:
        return []
    prime = [2]
    if n > 2:
        limit = int(math.sqrt(n))
        odd = [i for i in range(3, n + 1, 2)]
        while limit >= odd[0]:
            prime.append(odd[0])
            odd = [j for j in odd if j % odd[0] != 0]
        prime += odd
    return prime

from collections import defaultdict
def prime_factorization(n):
    if n <= 1:
        return {}
    else:
        # print(int(math.sqrt(n)))
        prime = get_prime(int(math.sqrt(n)))
        dct = defaultdict(int)
        for p in prime:
            while n % p == 0:
                dct[p] += 1
                n //= p
        if n != 1:
            dct[n] += 1
        dct = dict(dct)
        return dct

n = int(input())
pf = prime_factorization(n)

Z = []
for k, v in pf.items():
    for i in range(1, v + 1):
        Z.append(k ** i)
Z.sort()
count = 0
for z in Z:
    if n != 1:
        count += 1
        n //= z
    else:
        break

print(count)

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
    #x = int(c ** (1/i)) 
    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,100):
    a.append(i + a[i-1])
#print(a)
for i in pf:
    s = pf[i]
    c = s
    #x = int(c ** (1/i)) 
    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 = 2
counter = 0
while N != 1:
 if p > math.sqrt(N): break
 ind = 0
 n = -1
 while N % p == 0:
  N //= p
  ind += 1
 if ind == 0:
  p += 1
  continue
 while (n+1)*(n+2)//2 <= ind:
  n += 1
 counter += n
 p += 1

counter += 1

print(counter)

Submission status: Wrong Answer

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

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

ans = 0

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


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

Submission status: Wrong Answer

Solution code:
import math

def main():
    N = int(input())
    limit = int(math.sqrt(N)+1)
    count = 0
    for i in range(2,limit):
        if N%i==0:
            N//=i
            count += 1
        if N<i: break
    print(count)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

#import collections
#from bisect import *
from heapq import *

def linput(_t=int):
	return list(map(_t, input().split()))

def gcd(n,m):
    while m: n,m = m, n%m
    return n

def lcm(n,m): return n*m//gcd(n,m)

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

def main():
	N = int(input())
	#N,P,C,M = linput()

	res = 0
	vQ = prime_factorize(N)
	vQ.sort(reverse=True)
	
	sV = set([])
	t = 1
	for p in vQ:
		t *= p
		if t not in sV:
			N //= t
			sV |= {t}
			res += 1
			t = 1
		if N==1: break
	
	print(res)
	#print("{:.5f}".format(res/R))


main()

Submission status: Wrong Answer

Solution code:
def CountTimesforT(N, T):
    count = 0
    while N % T == 0:
        count += 1
        N //= T
    t, R = 1, 0
    while count >= t:
        R += 1
        count -= t
        t += 1
    return [R, N]

N = int(input())
M = int(pow(N, 0.5)) + 10
ans = 0
if N != 1:
    for i in range(2, M):
        if N % i == 0:
            l = CountTimesforT(N, i)
            N = l[1]
            ans += l[0]
if ans != 0:
    print(ans)
elif N == 1:
    print(0)
else:
    print(1)

Submission status: Wrong Answer

Solution code:
def CountTimesforT(N, T):
    count = 0
    while N % T == 0:
        count += 1
        N //= T
    t, R = 1, 0
    while count >= t:
        R += 1
        count -= t
        t += 1
    return [R, N]

N = int(input())
M = int(pow(N, 0.5)) + 2
ans = 0
if N != 1:
    for i in range(2, M):
        if N % i == 0:
            l = CountTimesforT(N, i)
            N = l[1]
            ans += l[0]
if ans != 0:
    print(ans)
elif N == 1:
    print(0)
else:
    print(1)

Submission status: Wrong Answer

Solution code:
n = int(input())
"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""
# n == 1のとき、[1, 1]を返す
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
num = factorization(n)
kazu = []
for num_i in num:
    cnt = 1 #num_i[0]
    hoge = num_i[0]
    for i in range(num_i[1]):
        cnt *= hoge
        kazu.append(cnt)
kazu.sort()
cnt = 0
ans = 1
while ans < n:
    ans *= kazu[cnt]
    cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
def CountTimesforT(N, T):
    t = T
    count = 0
    while N % t == 0:
        count += 1
        N //= t
        t *= T
    while N % T == 0:
        N //= T
    return [count, N]

N = int(input())
M = int(pow(N, 0.5)) + 2
ans = 0
if N != 1:
    for i in range(2, M):
        if N % i == 0:
            l = CountTimesforT(N, i)
            N = l[1]
            ans += l[0]
if ans != 0:
    print(ans)
elif N == 1:
    print(0)
else:
    print(1)

Submission status: Wrong Answer

Solution code:
def CountTimesforT(N, T):
    t = T
    count = 0
    while N % t == 0:
        count += 1
        N //= t
        t *= T
    while N % T == 0:
        N //= T
    return [count, N]

N = int(input())
M = int(pow(N, 0.5)) + 1
ans = 0
if N % 2 == 0:
    l = CountTimesforT(N, 2)
    N = l[1]
    ans += l[0]
if N != 1:
    for i in range(3, M, 2):
        if N % i == 0:
            l = CountTimesforT(N, i)
            N = l[1]
            ans += l[0]
if ans != 0:
    print(ans)
elif N == 1:
    print(0)
else:
    print(1)

Submission status: Wrong Answer

Solution code:
import math

def main():
    N = int(input())

    if N == 1:
        print(0)
        return

    # 素数の可能性の列挙
    def primes(x):
        if x < 2: return []

        primes = [i for i in range(x)]
        primes[1] = 0 # 1は素数ではない

        # エラトステネスのふるい
        for prime in primes:
            if prime > math.sqrt(x): 
                break
            if prime == 0: 
                continue
            for non_prime in range(2 * prime, x, prime): 
                primes[non_prime] = 0

        return [prime for prime in primes if prime != 0]

    prime_chand = primes(N)
    counter = 0

    while N != 1:
        for prime in prime_chand:
            if N % prime == 0:
                counter += 1
                N = N // prime 
                break
        if counter == 0:
            N = 1
            counter = 1
    
    print(counter)


main()

Submission status: Wrong Answer

Solution code:
import collections
N = int(input())
A =[]
n = int(N**(1/2))
while N%2 ==0:
  N = N//2
  A.append(2)
i = 3
while i <= n and i <= N:
  if N%i == 0:
    while N%i ==0:
      N = N//i
      A.append(i)
  i += 2

if N != 1:
  A.append(N)
c = collections.Counter(A)
k = list(c.values())
g = 0
for i in range(len(k)):
  t = k[i]
  if t < 3:
    g += 1
  elif t < 6:
    g += 2
  elif t < 10:
    g += 3
  elif t < 15:
    t += 4
  elif t < 21:
    g += 5
  elif t < 28:
    g += 6
  elif t < 36:
    g += 7
  elif t < 45:
    g += 8
print(g)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 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, j in factorization(N):
    n= 1
    while 2*j >= n*(n+1):
        n += 1
        ans += 1
    
print(ans)

Submission status: Wrong Answer

Solution code:
from math import sqrt
from bisect import bisect


def main():
    N = int(input())
    factor = {}
    max_count = 1
    while N > 1:
        for i in range(2, int(sqrt(N))):
            if N % i == 0:
                N = N // i
                if i in factor:
                    factor[i] += 1
                    if max_count < factor[i]:
                        max_count = factor[i]
                else:
                    factor[i] = 1
                break
        else:
            if N in factor:
                factor[N] += 1
                if max_count < factor[i]:
                    max_count = factor[i]
            else:
                factor[N] = 1
            N = 1

    sum_up = [n * (n + 1) // 2 for n in range(max_count+1)]
    ans = 0
    for prime, count in factor.items():
        ans += bisect(sum_up, count)-1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
n_ = n
n2 = n
sqrt = int(math.sqrt(n))
m = {}
#素因数分解
for i in range(2, sqrt):
    if n % i == 0:
        cnt = 0
        while n % i == 0:
            cnt += 1
            n /= i
        m[i] = cnt

ans = 0
for k, v in m.items():
    for i in range(1,v+1):
        if n_ % (k**i) == 0:
            n_ /= k**i
            ans += 1

if n_ % n2 == 0:
    ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
from queue import deque
from math import log2

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, 40):
        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:
from queue import deque
from math import log2

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, 10**12+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:
N = int(input())
if N == 1:
    print(0)
else:
    pl = []
    for i in range(1, int(N**0.5)+1):
        if N % i == 0:
            pl.append(i)
            pl.append(N//i)
    pl.sort()

    res = 0
    for p in pl[1:]:
        i = 1
        while True:
            if N % p**i == 0:
                N //= p**i
                res += 1
            else:
                break
            i += 1
    print(res)

Submission status: Wrong Answer

Solution code:
import collections

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


n = int(input())
c = collections.Counter(prime_factorize(n))
l = c.values()
ans=0
for i in list(l):
    temp = i
    j=1
    while temp>0:
        temp -= j
        j += 1
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
from queue import deque
from math import log2

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, 10**12):
        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:
from queue import deque
from math import log2

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(N))+1):
        if n**i <= N:
            kouho_num.add(n**i)
        else:
            break

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

divnum, countnum = 0, 0
pnum = set()

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:
from queue import deque
from math import log2

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(N)/log2(n))+1):
        if n**i <= N:
            kouho_num.add(n**i)
        else:
            break

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

divnum, countnum = 0, 0
pnum = set()

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)