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 math
from decimal import *
import random

def pf(n):
    rn = int(n)
    ans = {}
    while(n%2==0):
        if(2 not in ans):
            ans[2] = 1
        else:
            ans[2]+=1
        n//=2
    for i in range(3, int(math.sqrt(rn))+100, 2):
        while(n%i==0):
            if(i not in ans):
                ans[i] = 1
            else:
                ans[i]+=1
            n//=i
            if(n==1):
                break
        if(n==1):
            break
    if(n>2):
        ans[n]=1
    return ans
n = int(input())
d = pf(n)
if(d=={}):
    print(1)
else:
    ans = 0
    for x in d:
        left = 0
        right = int(1e20)
        while(left<right):
            mid = (left+right)//2
            if(((mid*(mid+1))//2) > d[x]):
                right = mid
            else:
                left = mid+1
        ans+=(left-1)
    print(ans)

Submission status: Wrong Answer

Solution code:
import math
from decimal import *
import random

def pf(n):
    rn = int(n)
    ans = {}
    while(n%2==0):
        if(2 not in ans):
            ans[2] = 1
        else:
            ans[2]+=1
        n//=2
    for i in range(3, int(math.sqrt(rn))+100
                   ):
        while(n%i==0):
            if(i not in ans):
                ans[i] = 1
            else:
                ans[i]+=1
            n//=i
            if(n==1):
                break
        if(n==1):
            break
    if(n!= 1):
        ans[n]=1
    return ans
n = int(input())
d = pf(n)
if(d=={}):
    print(1)
else:
    ans = 0
    for x in d:
        left = 0
        right = int(1e20)
        while(left<right):
            mid = (left+right)//2
            if(((mid*(mid+1))//2) > d[x]):
                right = mid
            else:
                left = mid+1
        ans+=(left-1)
    print(ans)

Submission status: Wrong Answer

Solution code:
import math
from decimal import *
import random

def pf(n):
    rn = int(n)
    ans = {}
    while(n%2==0):
        if(2 not in ans):
            ans[2] = 1
        else:
            ans[2]+=1
        n//=2
    for i in range(3, int(math.sqrt(rn))+5):
        while(n%i==0):
            if(i not in ans):
                ans[i] = 1
            else:
                ans[i]+=1
            n//=i
            if(n==1):
                break
        if(n==1):
            break
    if(n!= 1):
        ans[n]=1
    return ans
n = int(input())
d = pf(n)
if(d=={}):
    print(1)
else:
    ans = 0
    for x in d:
        left = 0
        right = int(1e20)
        while(left<right):
            mid = (left+right)//2
            if(((mid*(mid+1))//2) > d[x]):
                right = mid
            else:
                left = mid+1
        ans+=(left-1)
    print(ans)

Submission status: Wrong Answer

Solution code:
import math
from decimal import *
import random

def pf(n):
    rn = int(n)
    ans = {}
    while(n%2==0):
        if(2 not in ans):
            ans[2] = 1
        else:
            ans[2]+=1
        n//=2
    for i in range(3, int(math.sqrt(rn))+1):
        while(n%i==0):
            if(i not in ans):
                ans[i] = 1
            else:
                ans[i]+=1
            n//=i
            if(n==1):
                break
        if(n==1):
            break
    return ans
n = int(input())
d = pf(n)
if(d=={}):
    print(1)
else:
    ans = 0
    for x in d:
        left = 0
        right = int(1e20)
        while(left<right):
            mid = (left+right)//2
            if((mid*(mid+1))//2 > d[x]):
                right = mid
            else:
                left = mid+1
        ans+=(left-1)
    print(ans)

Submission status: Wrong Answer

Solution code:
import math
from decimal import *
import random

def pf(n):
    rn = int(n)
    ans = {}
    while(n%2==0):
        if(2 not in ans):
            ans[2] = 1
        else:
            ans[2]+=1
        n//=2
    for i in range(3, int(math.sqrt(rn))+1):
        while(n%i==0):
            if(i not in ans):
                ans[i] = 1
            else:
                ans[i]+=1
            n//=i
            if(n==1):
                break
        if(n==1):
            break
    return ans
n = int(input())
d = pf(n)
if(d=={}):
    print(1)
else:
    ans = 0
    for x in d:
        left = 0
        right = int(1e9)
        while(left<right):
            mid = (left+right)//2
            if((mid*(mid+1))//2 > d[x]):
                right = mid
            else:
                left = mid+1
        ans+=(left-1)
    print(ans)

Submission status: Wrong Answer

Solution code:
import math , sys

def fac(x,T):
    m = int(math.sqrt(x))+1
    i=2
    while x>1 and i <=m+2:
        ind=0
        while x%i == 0:
            ind+=1
            x=int(x/i)
        if ind>0:
            T.append( ind )
        i+=1
    return T

def sta ( x ):
    return int( 0.5* (-1 + math.sqrt(1+8*x)))
N = int( input() )

if N == 1:
    print(0)
    sys.exit()
if N == 2 or N ==3:
    print(1)
    sys.exit()
Is = fac( N , [] )
ans = sum( [ sta(j) for j in Is])
print(max(ans,1))

Submission status: Wrong Answer

Solution code:
import math , sys

def fac(x,T):
    m = int(math.sqrt(x))+1
    i=2
    while x>1 and i <=m+1:
        ind=0
        while x%i == 0:
            ind+=1
            x=int(x/i)
        if ind>0:
            T.append( ind )
        i+=1
    return T

def sta ( x ):
    return int( 0.5* (-1 + math.sqrt(1+8*x)))
N = int( input() )

Is = fac( N , [] )
ans = sum( [ sta(j) for j in Is])
print(ans)

Submission status: Wrong Answer

Solution code:
import math , sys

def fac(x,T):
    m = int(math.sqrt(x))+1
    i=2
    while x>1 and i <=m:
        ind=0
        while x%i == 0:
            ind+=1
            x=int(x/i)
        if ind>0:
            T.append( ind )
        i+=1
    return T

def sta ( x ):
    return int( 0.5* (-1 + math.sqrt(1+8*x)))
N = int( input() )

Is = fac( N , [] )
ans = sum( [ sta(j) for j in Is])
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
 
from collections import Counter
 
f = Counter()

factors = []
for i in range(2, min(int(n ** 0.5 + 1), n + 1)):
  factors.append(i)
  factors.append(n // i)

for factor in factors:
    while n % factor == 0:
        n //= factor
        f[factor] += 1

 
    
def bsearch(test, lo, hi):
  while lo != hi:
    mid = (lo + hi + 1) // 2
    if test(mid):
      lo = mid
    else:
      hi = mid - 1
  return lo
 
ans = 0
for p, q in f.items():
  ans += bsearch(lambda w: w * (w + 1) // 2 <= q, 0, 10 ** 12)
 
if ans == 0 and n > 1:
    print(1)
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
 
from collections import Counter
 
f = Counter()
 
for i in range(2, min(int(n ** 0.5 + 1), n + 1)):
  while n % i == 0:
    f[i] += 1
    n //= i
 
    
def bsearch(test, lo, hi):
  while lo != hi:
    mid = (lo + hi + 1) // 2
    if test(mid):
      lo = mid
    else:
      hi = mid - 1
  return lo
 
ans = 0
for p, q in f.items():
  ans += bsearch(lambda w: w * (w + 1) // 2 < q, 0, 10 ** 12)
 
if ans == 0 and n > 1:
    print(1)
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

from collections import Counter

f = Counter()

for i in range(2, min(int(n ** 0.5 + 1), n + 1)):
  while n % i == 0:
    f[i] += 1
    n //= i

    
def bsearch(test, lo, hi):
  while lo != hi:
    mid = (lo + hi + 1) // 2
    if test(mid):
      lo = mid
    else:
      hi = mid - 1
  return lo

ans = 0
for p, q in f.items():
  ans += bsearch(lambda w: w * (w + 1) // 2 < q, 0, 10 ** 12) + 1

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

Submission status: Wrong Answer

Solution code:
n = int(input())

from collections import Counter

f = Counter()

for i in range(2, min(int(n ** 0.5 + 1), n + 1)):
  while n % i == 0:
    f[i] += 1
    n //= i

    
def bsearch(test, lo, hi):
  while lo != hi:
    mid = (lo + hi + 1) // 2
    if test(mid):
      lo = mid
    else:
      hi = mid - 1
  return lo

ans = 0
for p, q in f.items():
  ans += bsearch(lambda w: w * (w + 1) // 2 <= q, 0, 10 ** 12)

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

Submission status: Wrong Answer

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

#Prime factoring
pf = []
for i in range(2,math.ceil(n**0.5)+1):
    temp = 0
    while n%i==0:
        n //= i
        temp += 1
    if temp:
        pf.append(temp)
    if n==1:
        break
if not pf and n!=1:
    pf.append(1)

ans =  0
for i in range(len(pf)):
    j = 1
    while pf[i]-j>=0:
        ans += 1
        pf[i] -= j
        j += 1
print(ans)

Submission status: Wrong Answer

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

#Prime factoring
pf = []
for i in range(2,math.ceil(n**0.5)+1):
    temp = 0
    while n%i==0:
        n /= i
        temp += 1
    if temp:
        pf.append(temp)
    if n==1:
        break
if not pf and n!=1:
    pf.append(1)

ans =  0
for i in range(len(pf)):
    j = 1
    while pf[i]-j>=0:
        ans += 1
        pf[i] -= j
        j += 1
print(ans)

Submission status: Wrong Answer

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

#Prime factoring
pf = []
for i in range(2,math.ceil(n**0.5)+1):
    temp = 0
    while n%i==0:
        n /= i
        temp += 1
    if temp:
        pf.append(temp)
    if n==1:
        break
if not pf:
    pf.append(1)

ans =  0
for i in range(len(pf)):
    j = 1
    while pf[i]-j>=0:
        ans += 1
        pf[i] -= j
        j += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
#import numpy as np
from math import sqrt, floor
def main():
    def factorization(n):
        l = []
        t = n
        for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
            if t % i == 0:
                cnt = 0
                while t % i == 0:
                    cnt += 1
                    t = t // i
                l.append([i, cnt])
        if t != 1:
            l.append([t, 1])
        if not l:
            l.append([n, 1])
        return l
    n = int(input())
    if n == 1:
        print(0)
        sys.exit()
    p = factorization(n)
    r = 0
    for pe in p:
        r += floor(sqrt(pe[1]*2))
    print(r)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# ABC169 D
N=int(input())

def factorization(N):
    res=[]
    for i in range(2,int(N**(1/2))+2):
        if not N%i:
            r=0
            while not N%i:
                N//=i
                r+=1
            res.append((i,r))
    if N>1:
        res.append((N,1))
    return res

fact=factorization(N)

res=0
for p,r in fact:
    res+=(r+1).bit_length()-1
print(res)

Submission status: Wrong Answer

Solution code:
# ABC169 D
N=int(input())

def factorization(N):
    res=[]
    for i in range(2,int(N**(1/2))+2):
        if not N%i:
            r=0
            while not N%i:
                N//=i
                r+=1
            res.append((i,r))
    if N>1:
        res.append((N,1))
    return res

fact=factorization(N)

res=0
print(fact)
for p,r in fact:
    res+=(r+1).bit_length()-1
print(res)

Submission status: Wrong Answer

Solution code:
n = int(input())

def divGame(N=n):
  if N == 1:
    return 0
  if N == 2:
    return 1
  
  factors = []
  
  count = 0
  while N % 2 == 0:
    N /= 2
    count += 1
  if count != 0:
    factors.append(count)

  for i in range(3, int(N**0.5 + 1), 2):
    count = 0
    while N % i == 0:
      N /= i
      count += 1
    if count != 0:
      factors.append(count)
  if N != 1:
    factors.append(1)

  factors.sort()

  answer = 0
  accum = 1
  count = 1
  for i in range(len(factors)):
    while factors[i] > accum:
      count += 1
      accum += count
    answer += count

  return answer

print(divGame())

Submission status: Wrong Answer

Solution code:
n = int(input())

pf = {}


for i in range(2,int(n**0.5)+1):
    while n%i == 0:
        pf[i] = pf.get(i,0)+1
        n //= i

num_group = [0]*11 #2**50 > 10**12  55=1+2+...+10
for i in range(10):
    num_group[i+1] = num_group[i] + (i+1)
#print(num_group)

ans = 0
for prime in pf.keys():
    for i in range(11):
      if pf[prime]<num_group[i]:
          break
    ans += i-1
print(ans)

Submission status: Wrong Answer

Solution code:
import copy
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

L=prime_factorize(n)
M=L.copy()
M=list(set(M))

cnt=0
for x in M:
    m=L.count(x)
    for i in range(L.count(x)):
        if m-i-1 > 0:
            m -= i+1
            cnt += 1

print(cnt)

Submission status: Wrong Answer

Solution code:
import copy
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

L=prime_factorize(n)
M=L.copy()
M=list(set(M))

cnt=0
for x in M:
    m=L.count(x)
    for i in range(L.count(x)):
        if m > 0:
            m -= i+1
            cnt += 1

print(cnt)

Submission status: Wrong Answer

Solution code:
import collections

n = int(input())

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

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

c = collections.Counter(prime_factorize(n))
_, counts = zip(*c.most_common())

l = list(counts)
ans = 0

if l == [1]: # prime number
    print(1)
    exit()

for i in l:
    for j in range(1, i):
        if i >= j:
            i -= j
            ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
import math


def prime(num):
	array=[]
	tmp=int(math.sqrt(n))+1
	for i in range(2,tmp):
		while num % i == 0:
			num/=i
			array.append(i)
	# リストが空なら入力(num)は素数
	
	if array==[]:
		return [num]
	else:
		if n>1:
			array.append(int(n))
		return array

n=int(input())
P=prime(n)
P=sorted(P)


if 1 in P:
	print(0)
else:
	ans=0
	tmp=0
	for i in range(0,len(P)):
		if i==0:
			tmp=P[i] 
		elif P[i]==P[i-1]:
			tmp*=P[i]
		else:
			tmp=P[i]

		if n%tmp==0:
			n/=tmp
			ans+=1
	print(ans)

Submission status: Wrong Answer

Solution code:
import math

def prime(num):
	array=[]
	tmp=int(math.sqrt(n))+1
	for i in range(2,tmp):
		while num % i == 0:
			num/=i
			array.append(i)
	# リストが空なら入力(num)は素数
	if array==[]:
		return [num]
	else:
		return array
      
      
n=int(input())
P=prime(n)
P=sorted(P)


if 1 in P:
	print(0)
else:
	ans=0
	tmp=0
	for i in range(0,len(P)):
		if i==0:
			tmp=P[i] 
		elif P[i]==P[i-1]:
			tmp*=P[i]
		else:
			tmp=P[i]

		if n%tmp==0:
			n/=tmp
			ans+=1
	print(ans)

Submission status: Wrong Answer

Solution code:
import math

def prime(num):
	array=[]
	tmp=int(math.sqrt(n))+1
	for i in range(2,tmp):
		while num % i == 0:
			num/=i
			array.append(i)
	# リストが空なら入力(num)は素数
	if array==[]:
		return [num]
	else:
		return array
      
n=int(input())
P=prime(n)
tmp=P[0]

if 1 in P:
	print(0)
else:
	ans=0
	for i in range(0,len(P)):
		if i==0:
			tmp=P[i] 
		elif P[i]==P[i-1]:
			tmp*=P[i]
		else:
			tmp=P[i]

		if n%tmp==0:
			n/=tmp
			ans+=1
	print(ans)

Submission status: Wrong Answer

Solution code:
import math

def prime(num):
	array=[]
	tmp=int(math.sqrt(n))+1
	for i in range(2,tmp):
		while num % i == 0:
			num/=i
			array.append(i)
	# リストが空なら入力(num)は素数
	if array==[]:
		return [num]
	else:
		return array
      
n=int(input())
P=prime(n)
tmp=P[0]

if 1 in P:
	print(0)
else:
	ans=0
	for i in range(0,len(P)):
		if i==0:
			tmp=P[i] 
		elif P[i]==P[i-1]:
			tmp*=P[i]
		else:
			tmp=P[i]

		if n%tmp==0:
			n/=tmp
			ans+=1
		print(n)
	print(ans)

Submission status: Wrong Answer

Solution code:
import math

def prime(num):
	array=[]
	tmp=int(math.sqrt(n))+1
	for i in range(2,tmp):
		while num % i == 0:
			num/=i
			array.append(i)
	# リストが空なら入力(num)は素数
	if array==[]:
		return [num]
	else:
		return array

n=int(input())
P=prime(n)
num=n
tmp=P[0]

if 1 in P:
	print(0)
else:	
	ans=1
	for i in range(1,len(P)):
		if P[i]==P[i-1]:
			tmp*=P[i]
		else:
			tmp=P[i]

		if num%tmp==0:
			num/=tmp
			ans+=1

	print(ans)

Submission status: Wrong Answer

Solution code:
import math

def prime(num):
	array=[]
	tmp=int(math.sqrt(n))+1
	for i in range(2,tmp):
		while num % i == 0:
			num/=i
			array.append(i)
	# リストが空なら入力(num)は素数
	if array==[]:
		return [num]
	else:
		return array
      
		
n=int(input())
P=prime(n)
num=n
tmp=P[0]

if len(P)==1:
	print(0)
else:	
	ans=1
	for i in range(1,len(P)):
		if P[i]==P[i-1]:
			tmp*=P[i]
		else:
			tmp=P[i]

		if num%tmp==0:
			num/=tmp
			ans+=1

	print(ans)

Submission status: Wrong Answer

Solution code:
import math

def prime(num):
	array=[]
	tmp=int(math.sqrt(n))+1
	for i in range(2,tmp):
		while num % i == 0:
			num/=i
			array.append(i)
	# リストが空なら入力(num)は素数
	if array==[]:
		return [num]
	else:
		return array
      
n=int(input())
P=prime(n)
num=n
ans=1
tmp=P[0]

for i in range(1,len(P)):
	if P[i]==P[i-1]:
		tmp*=P[i]
	else:
		tmp=P[i]

	if num%tmp==0:
		num/=tmp
		ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
m = n
primes = {}

for i in range(2, int(n**0.5+2)):
  while m % i == 0:
    m //= i
    if i not in primes:
      primes[i] = 1
    else:
      primes[i] += 1
  if i > m:
    if m != 1:
      primes[m] = 1
    break

if len(primes) == 0 and n != 1:
  primes[n] = 1

cnt = 0
num = 0
flag = True

while flag == True:
  num += 1
  flag = False
  for i in primes:
    if 0 < primes[i] <= num*2:
      cnt += 1
      primes[i] = 0
    elif primes[i] > num*2:
      cnt += 1
      flag = True
      primes[i] -= num

print(cnt)

Submission status: Wrong Answer

Solution code:
n = int(input())

cnt = 0
m = n

for i in range(2, int(n**0.5)+1):
  if m % i == 0:
    m //= i
    cnt += 1
    if m < i:
      break

if cnt == 0:
  if n == 1:
    print('0')
  else:
    print('1')

else:
  print(cnt)

Submission status: Wrong Answer

Solution code:
n=int(input())
def f(x):
    z=1
    while not(z*(z+1)<=2*x<(z+1)*(z+2)):
        z+=1
    return z
x=[-1]*(10**6+1) #2以上の自然数に対して最小の素因数を表す
x[0]=0
x[1]=1
i=2
prime=[]
while i<=10**6:
    if x[i]==-1:
        x[i]=i
        prime.append(i)
    for j in prime:
        if i*j>10**6 or j>x[i]:break
        x[j*i]=j
    i+=1
if n==1:
    print(0)
    exit()
y=0
j=2
while j*j<=n:
    if n%j==0:
        y=1
    j+=1
if y==0:
    print(1)
    exit()
a=[]
q=0
for i in range(len(prime)):
    p=prime[i]
    while n%p==0:
        q+=1
        n=n//p
    if q>0:a.append(q)
    q=0

ans=0
for i in range(len(a)):
    ans+=f(a[i])
print(ans)

Submission status: Wrong Answer

Solution code:
# import queue
def main():
    N = int(input())
    n = N
    prime = [True for i in range(10**6+1)]
    prime[0] = False
    prime[1] = False
    for i in range(2, len(prime)):
        if prime[i] == True:
            for j in range(i*2, len(prime), i):
                prime[j] = False

    ans = 0
    for i in range(len(prime)):
        if prime[i] == True and n % i == 0:
            p = i
            flag = False
            while n % p == 0:
                ans += 1
                n = n//p
                p *= i

    if N != 1 and n == N:
        ans += 1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# import queue
def main():
    N = int(input())
    n = N
    prime = [True for i in range(10**6+1)]
    prime[0] = False
    prime[1] = False
    for i in range(2, len(prime)):
        if prime[i] == True:
            for j in range(i*2, len(prime), i):
                prime[j] = False

    ans = 0
    for i in range(len(prime)):
        if prime[i] == True and n % i == 0:
            p = i
            while n % p == 0:
                ans += 1
                n = n//p
                p *= i
    for i in range(len(prime)):
        if prime[i] == True and n % i == 0:
            p = i
            while n % p == 0:
                ans += 1
                n = n//p
                p *= i
    if n == N:
        ans += 1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
res = {}
ans = 0
i = 2

for i in range(2,int(N**(1/2))+1) :
    while(N%i == 0) :
        if(i not in res) :
            res[i] = 1
        else :
            res[i] += 1
        N = N // i
if(N != 1) :
    res[N] = 1

for i in res :
    b = 1
    s = res[i]
    while(b <= s) :
        ans += 1
        s -= 1
        b += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
res = {}
ans = 0
i = 2

while(i**2 <= N):
    while(N%i == 0) :
        if(i not in res) :
            res[i] = 1
        else :
            res[i] += 1
        N /= i
    i += 1
if(N != 1) :
    res[N] = 1

for i in res :
    b = 1
    s = res[i]
    while(b <= s) :
        ans += 1
        s -= 1
        b += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
res = {}
ans = 0

for i in range(2,int(N**(1/2))+1) :
    while(N%i == 0) :
        if(i not in res) :
            res[i] = 1
        else :
            res[i] += 1
        N /= i
if(N != 1) :
    res[N] = 1

for i in res :
    b = 1
    s = res[i]
    while(b <= s) :
        ans += 1
        s -= 1
        b += 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])

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

    return arr
  
def divcount(n):
  cnt=0
  while n>=0:
    n-=cnt+1
    cnt+=1
  return cnt-1

s=factorization(N)
t=[i[1] for i in s]
ans=0
for i in t:
  ans+=divcount(i)
print(ans)

Submission status: Wrong Answer

Solution code:
a,n=0,int(input())
for i in range(2,10**6):
  x=j=0
  while n%i<1:n/=i;x+=1
  while x>=j:a+=1;j+=1;x-=j
print(a+(n>1))

Submission status: Wrong Answer

Solution code:
a,n=0,int(input())
for i in range(2,int(n**0.5+1)):
  x=0
  while(n%i==0):n//=i;x+=1
  j=1
  while(x>=j):a+=1;x-=j;j+=1
print(1 if n-1 else a)

Submission status: Wrong Answer

Solution code:
import bisect
n=int(input())
if n==1:
    print(0)
    exit()
def 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 ra(a):
    ll,l=[],1
    for i in range(len(a)-1):
        if a[i]==a[i+1]:
            l+=1
        else:
            ll.append(l)
            l=1
    ll.append(l)
    return ll
l=ra(factorize(n))
c=[1]
for i in range(2,10**4):
    c.append(i+c[-1])
ans=0
for i in l:
    ans+=bisect.bisect_left(c,i)+1
print(ans)

Submission status: Wrong Answer

Solution code:
import bisect
n=int(input())
def 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 ra(a):
    ll,l=[],1
    for i in range(len(a)-1):
        if a[i]==a[i+1]:
            l+=1
        else:
            ll.append(l)
            l=1
    ll.append(l)
    return ll
l=ra(factorize(n))
c=[1]
for i in range(2,10**4):
    c.append(i+c[-1])
ans=0
for i in l:
    ans+=bisect.bisect_left(c,i)
print(ans)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
d = n
m = {}

for i in range(2, int(math.sqrt(n)) + 1):
    m[i] = 0
    while (d % i == 0):
        d //= i
        m[i]+=1
res = 0
print(m)
for i in m.values():
    res+=int(math.sqrt(i*2))
if d > 1:
    res += 1
print(res)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0

## execute
d = 2
while d*d <= N:
  if N % d == 0:
    z = d
    while N % z == 0:
      N /= z
      ans += 1
      z *= d
  d += 1

print(ans)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
d = n
m = {}
for i in range(2, int(math.sqrt(n)) + 1):
    m[i] = 1
    while (d % i == 0):
        m[i] += 1
        d //= i
res = 0
for i in m.values():
    res+=i//2

if d > 1:
    res += 1
print(res)

Submission status: Wrong Answer

Solution code:
"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""

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())

a = factorization(n)
#print(a)
ans = 0
for i in a:
  t = i[1]
  c=1
  tmp = 0
  while(tmp<=t):
    tmp+=c
    c+=1
  ans+=(c-2)
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Primes = Prime_Factorize(N)
print(Primes,N)
cnt = 0
for p in Primes:
    e = 1
    z = p
    while (N%z == 0) and (N >= z):
        print('N,z,p,e',N,z,p,e)
        N //= z
        e += 1 
        z = p**e
        cnt += 1
    while N%p == 0:
        N //= p
print(cnt)

Submission status: Wrong Answer

Solution code:
#D - Div Game
N = int(input())

def Prime_factorize(n):
    cnt = 0
    A = []
    #2の倍数で割っていく
    z = 2
    while n%z==0 and (n>=z):
        cnt += 1
        n //= z
        A.append(z)
        #割るたびに2倍
        z *= 2
    #割る始めの数をfとして保持
    while n%2 == 0:
        n//=2
    f = 3
    z = 3
    #sqrt(n)以内に全ての素因数は含まれる
    while f*f <= n:
        if n%z == 0:
            cnt += 1
            n //= z
            A.append(z)
            #割るたびにf倍
            z = z*f
        #fで割り切れなかったら(f+2)してf_divもリセット
        else:
            f += 2
            z = f
    #残ったnが以前に選んだもので割り切れないとき
    if n != 1 and all((n%i != 0 for i in A)):
        A.append(z)
        cnt += 1
    #素数のとき
    if cnt == 0:
        cnt = 1
    return cnt
if N == 1:
    ans = 0
else:
    ans = Prime_factorize(N)
print(ans)

Submission status: Wrong Answer

Solution code:
#D - Div Game
N = int(input())

def Prime_factorize(n):
    cnt = 0
    A = []
    #2の倍数で割っていく
    z = 2
    while n%z==0 and (n>=z):
        cnt += 1
        n //= z
        A.append(z)
        #割るたびに2倍
        z *= 2
    #割る始めの数をfとして保持
    while n%2 == 0:
        n//=2
    f = 3
    z = 3
    #sqrt(n)以内に全ての素因数は含まれる
    while f*f <= N:
        if n%z == 0:
            cnt += 1
            n //= z
            A.append(z)
            #割るたびにf倍
            z = z*f
        #fで割り切れなかったら(f+2)してf_divもリセット
        else:
            f += 2
            z = f
    #残ったnが以前に選んだもので割り切れないとき
    if n != 1 and all((n%i != 0 for i in A)):
        A.append(z)
        cnt += 1
    #素数のとき
    if cnt == 0:
        cnt = 1
    return cnt
if N == 1:
    ans = 0
else:
    ans = Prime_factorize(N)
print(ans)

Submission status: Wrong Answer

Solution code:
#D - Div Game
N = int(input())

def Prime_factorize(n):
    cnt = 0
    A = []
    #2の倍数で割っていく
    z = 2
    while n%z==0 and (n>=z):
        cnt += 1
        n //= z
        A.append(z)
        #割るたびに2倍
        z *= 2
    #割る始めの数をfとして保持
    while n%2 == 0:
        n//=2
    f = 3
    z = 3
    #sqrt(n)以内に全ての素因数は含まれる
    while z <= n:
        if n%z == 0:
            cnt += 1
            n //= z
            A.append(z)
            #割るたびにf倍
            z = z*f
        #fで割り切れなかったら(f+2)してf_divもリセット
        else:
            f += 2
            z = f
    #残ったnが以前に選んだもので割り切れないとき
    if n != 1 and all((n%i != 0 for i in A)):
        A.append(z)
        cnt += 1
    #素数のとき
    if cnt == 0:
        cnt = 1
    return cnt
if N == 1:
    ans = 0
else:
    ans = Prime_factorize(N)
print(ans)

Submission status: Wrong Answer

Solution code:
#D - Div Game
N = int(input())

def Prime_factorize(n):
    cnt = 0
    A = []
    #2の倍数で割っていく
    z = 2
    while n%z==0 and (n>=z):
        cnt += 1
        n //= z
        A.append(z)
        #割るたびに2倍
        z *= 2
    #割る始めの数をfとして保持
    while n%2 == 0:
        n//=2
    f = 3
    z = 3
    #sqrt(n)以内に全ての素因数は含まれる
    while f*f <= N:
        if n%z == 0:
            cnt += 1
            n //= z
            A.append(z)

            #割るたびにf倍
            z = z*f
        #fで割り切れなかったら(f+2)してf_divもリセット
        else:
            f += 2
            z = f

    #残ったnが以前に選んだもので割り切れないとき
    if n != 1 and all((n%i != 0 for i in A)):
        A.append(z)
        cnt += 1
    #素数のとき
    if cnt == 0:
        cnt = 1
    return cnt
if N == 1:
    ans = 0
else:
    ans = Prime_factorize(N)
print(ans)

Submission status: Wrong Answer

Solution code:
#D - Div Game
N = int(input())

def Prime_factorize(n):
    cnt = 0
    A = []
    #2の倍数で割っていく
    z = 2
    while n%z==0 and (n>=z):
        cnt += 1
        n //= z
        A.append(z)
        #割るたびに2倍
        z *= 2
    #割る始めの数をfとして保持
    while n%2 == 0:
        n//=2
    f = 3
    z = 3
    #sqrt(n)以内に全ての素因数は含まれる
    while f*f <= n:
        if n%z == 0:
            cnt += 1
            n //= z
            A.append(z)

            #割るたびにf倍
            z = z*f
        #fで割り切れなかったら(f+2)してf_divもリセット
        else:
            f += 2
            z = f

    #残ったnが以前に選んだもので割り切れないとき
    if n != 1 and all((n%i != 0 for i in A)):
        A.append(z)
        cnt += 1
    #素数のとき
    if cnt == 0:
        cnt = 1
    return cnt
if N == 1:
    ans = 0
else:
    ans = Prime_factorize(N)
print(ans)